-
Notifications
You must be signed in to change notification settings - Fork 97
Fix import suggestions when dot is typed #800
Conversation
I tried adding a completion test, but for some reason module suggestions are not being captured. It is not clear to me why.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you sir!
While this fixes the bug in ghcide, I suspect the bug is upstream. What to do? I'm happy to merge this now and roll it back later if the fix is replicated in haskell-lsp. Equally happy to wait for the fix to land in haskell-lsp. Your choice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get a test, so that this will not break silently again?
@lazamar are you planning to add tests in this PR? I need this commit for a merge of my hls-3 branch, so if you aren't keen on doing this soon, I can try to include some tests in the upcoming and merge this as is. |
@wz1000 I wrote a brief test here lazamar@4aefe73 but couldn't get completions to show up. |
I believe the issue with that test is that the Position is 0-indexed, so you need to subtract 1 from the coordinates. |
Also, we need a stale parsed module to generate completions, so the module has to compile initially, and then the partial import line has to be added in. |
* Fix module suggestions * Document PositionMapping * Remove maybe
* Fix module suggestions * Document PositionMapping * Remove maybe
* Fix module suggestions * Document PositionMapping * Remove maybe
* Fix module suggestions * Document PositionMapping * Remove maybe
Fixes #613 and #342 at haskell-language-server.
Before
After