-
-
Notifications
You must be signed in to change notification settings - Fork 390
Rename a constructor renames all record fields #2915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, Thanks for the report! Please could you update the link to the commit for the steps to reproduce? It looks like the repository might be private. @br4ch1st0chr0n3 |
Hi, sorry for that. Should be public now, @OliverMadine. |
It seems like the issue is hie files including record field names as references to the constructor. @wz1000 maybe you have some more insight? |
Is this a bug or a feature? If it is a bug, we will need to report it in the GHC bug tracker and ideally contribute a fix. And back port the fixes to hie-compat: https://github.com/haskell/haskell-language-server/tree/master/hie-compat |
* test: add tests for record puns * feat: rename indirect references refactor: remove "safe" from function names * test: ignore record field tests for ghc92 (#2915) * test: ignore record field tests for ghc90 (#2915) * fix: update record field test ignore message * expand comment about indirect reference renaming * fix: find all punned references * test: ignore record field pun test for ghc > 9 * docs: mention test in indirect pun explaination * link issue for ignored record field rename tests Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Is this still a problem? |
Yes. I've gotten bitten by this yesterday at least with HLS 2.5.0.0. |
I've just tested and confirmed that it still occurs with HLS 2.6.0.0. |
Perhaps the |
Note that I took a stab at fixing this in #4089 That fix works, but requires changes on hiedb side (skipping indexing of all Identifiers whose NodeOrigin is GeneratedInfo). |
Yes that fix looks good I also make an issue for the type change as well https://gitlab.haskell.org/ghc/ghc/-/issues/24751 |
Is wz1000/HieDb#77 sufficient to solve this? Or do we still need a solution on GHC-side? Edit: Sorry. I wanted to refer to wz1000/HieDb#78. |
Yes, I think so |
(English is not my native language, please excuse me if the answer is obvious.) Does this reply mean "Yes, I think ... is sufficient to solve this" or "Yes, I think we still need a solution on GHC-side"? |
@SmartHypercube . Former, but better if we do it in ghc too. |
Your environment
Which OS do you use:
Ubuntu 20.04
Which LSP client (editor/plugin) do you use:
VS Code, Haskell extension v2.2.0, ghc 9.2.0, HLS 1.7.0.0
Describe your project (alternative: link to the project):
A .yml parser.
Steps to reproduce
See examples in #3106 (comment)
Expected behaviour
Only the constructor name is updated
Actual behaviour
All fields of a record are renamed the same as the new consructor name
Include debug information
The text was updated successfully, but these errors were encountered: