-
-
Notifications
You must be signed in to change notification settings - Fork 403
Implement signature help #4626
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
Draft
jian-lin
wants to merge
37
commits into
haskell:master
Choose a base branch
from
linj-fork:pr/signature-help
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+905
−24
Draft
Implement signature help #4626
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
7a54a1d
WIP: add basic boilerplate for signature help plugin
jian-lin 9168b74
WIP: finish signature help plugin MVP
jian-lin 4d7fa57
WIP: remove unused dependencies
jian-lin 622c8ec
WIP: fix func-tests
jian-lin 62fbccf
WIP: add basic tests
jian-lin a6635ca
Change expected test results considering the cursor shape
jian-lin bf0b4d5
Replace maybe with case for better readability
jian-lin c95d6e4
Call extractInfoFromSmallestContainingFunctionApplicationAst once
jian-lin 3dc1ec8
Add missing ParameterInformation for multi-line tests
jian-lin dca1311
Add a signature help test for type constraint with kind signatures
jian-lin 471958f
Add a signature help test for higher-order function
jian-lin d603ec4
Show more types: each type as one signature help
jian-lin faa4e48
Adjust import for the removal of hie-compat (#4613)
jian-lin 9bea0e3
Use structured type and type string to generate signature help
jian-lin db5e59e
Add signature help test: 2 type constraints
jian-lin fdd5acd
Add signature help test: middle =>
jian-lin c6ece42
Add signature help test: => in argument
jian-lin fe2d618
Add 2 signature help tests: RankNTypes(forall in middle)
jian-lin c3224d7
Add signature help test: LinearTypes
jian-lin 081ea8f
Add another signature help tests: RankNTypes(forall in middle)
jian-lin a522e88
Show function documentation in signature help
jian-lin d826d06
Show function argument documentation in signature help
jian-lin 62f2e41
Rename a local variable
jian-lin 35399e7
Do not error if doc is not available
jian-lin c0f7844
Add a helper function to create markdown doc
jian-lin eeeb283
Make signature helps reproducible before comparing them
jian-lin f1d19ba
Do not show uris in the argument documentation
jian-lin 433a8ad
Add a signature help test: imported function with argument doc
jian-lin d3d7d12
Add a signature help test: imported function with no doc
jian-lin e0a7e8b
Remove an outdated TODO item
jian-lin e6702b7
Remember previous active signature
jian-lin 3d7a67b
Update a TODO item
jian-lin 800f908
Show signature help even when there are type applications
jian-lin cb84480
Fix some tests for ghc > 9.8 due to changed doc
jian-lin c7931a2
Fix some tests for ghc > 9.8 due to changed type: Any -> ZonkAny 0
jian-lin b6d4617
Add jian-lin as codeowner of hls-signature-help-plugin
jian-lin 9a1de4e
Add hls-signature-help-plugin to some documentation files
jian-lin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Instead of creating a new
ArgDocMap
, an alternative implementation is to extendDocMap
toNameEnv (SpanDoc, IntMap SpanDoc)
.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.
That sounds sensible to me? Any reason not to do that?
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.
I do not have a strong opinion on this. I will change the code to
type DocMap = NameEnv (SpanDoc, IntMap SpanDoc)
.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.
Looking at the code it seems like it would simplifiy things quite a lot.
Uh oh!
There was an error while loading. Please reload this page.
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.
Now I have second thoughts about this because the alternative implementation
type DocMap = NameEnv (SpanDoc, IntMap SpanDoc)
is semantically incorrect. The semantically correct version should betype DocMap = NameEnv (Maybe SpanDoc, IntMap SpanDoc)
ortype DocMap = NameEnv (Maybe SpanDoc, Maybe (IntMap SpanDoc))
because aName
can have only function doc or arg doc.I prefer to keep the old implementation, i.e., introducing a new
ArgDocMap
, since the semantically correct version of the alternative implementation seems more complicated.