-
Notifications
You must be signed in to change notification settings - Fork 24
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
Record constructors being given as references to the fields with GHC versions >= 9 #45
Comments
Nag @wz1000 ? |
Hi, @wz1000! Any news on that? |
I looked into where these duplicate references to data constructors are coming from and here's what I found: For this example module module A where
data Foo = Bar { a :: !Int , b :: !Int } We end up with the following in the refmap here (Right Bar,
[ (A.hs:2:12-14, Details: Nothing {declaration of constructor bound at: A.hs:2:12-40})
, (A.hs:2:18, Details: Nothing {usage}) -- corresponds to src span of "a" field
, (A.hs:2:30, Details: Nothing {usage}) -- corresponds to src span of "b" field
]) This flat function "flattens" this info into [ (Right Bar, (A.hs:2:12-14, Details: Nothing {declaration of constructor bound at: A.hs:2:12-40}))
, (Right Bar, (A.hs:2:18, Details: Nothing {usage}))
, (Right Bar, (A.hs:2:30, Details: Nothing {usage}))
] and we end up with 3 references to Bar constructor, although just one of the 3 identifierDetails in the RefMap was actual reference to the Bar constructor: @wz1000 I could use some hints on how to proceed. |
Example
When querying for the
point-refs
at line 1 column 22 (i.e. on thefield
name), theFoo
constructor is given as a reference.Version
This seems to only be an issue with GHC versions >= 9
This is causing haskell-language-server/#2915.
The text was updated successfully, but these errors were encountered: