-
-
Notifications
You must be signed in to change notification settings - Fork 443
Fix Signature Help inside do Notation in GHC >= 9.10
#4904
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ import Development.IDE.Core.PluginUtils (runIdeActionE, | |
| import Development.IDE.Core.PositionMapping (fromCurrentPosition) | ||
| import Development.IDE.GHC.Compat (FastStringCompat, Name, | ||
| RealSrcSpan, | ||
| generatedNodeInfo, | ||
| getSourceNodeIds, | ||
| isAnnotationInNodeInfo, | ||
| mkRealSrcLoc, | ||
|
|
@@ -295,11 +296,19 @@ getNodeNameAndTypes hieKind hieAst = | |
| Nothing -> Nothing | ||
| Just name -> | ||
| let mTypeOfName = identType identifierDetails | ||
| -- types from the source NodeInfo | ||
| typesOfNode = case sourceNodeInfo hieAst of | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The fallback logic is:
The current implementation uses two separated checks for |
||
| Nothing -> [] | ||
| Just nodeInfo -> nodeType nodeInfo | ||
| -- fall back to generated NodeInfo when source has no types | ||
|
Comment on lines
+304
to
+308
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment is kind of confusing: it comes too late because I think we should move the comment to the top of the |
||
| typesOfGeneratedNode = case generatedNodeInfo hieAst of | ||
| Nothing -> [] | ||
| Just nodeInfo -> nodeType nodeInfo | ||
| allTypes = case mTypeOfName of | ||
| Nothing -> typesOfNode | ||
| Nothing -> | ||
| case typesOfNode of | ||
| [] -> typesOfGeneratedNode | ||
| ts -> ts | ||
|
Comment on lines
-302
to
+316
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. blocking: This handles the fallback of I would handle the fallback in one place before |
||
| -- (the last?) one type of 'typesOfNode' may (always?) be the same as 'typeOfName' | ||
| -- To avoid generating two identical signature helps, we do a filtering here | ||
| -- This is similar to 'dropEnd1' in Development.IDE.Spans.AtPoint.atPoint | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.