-
Notifications
You must be signed in to change notification settings - Fork 92
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
Call hierarchy support #332
Conversation
@July541 great work, i'll review it asap |
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.
LGTM, although I'm never sure all the places that need to be updated with capabilities etc!
|
||
data CallHierarchyItem = | ||
CallHierarchyItem | ||
{ _name :: Text |
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 include haddock corresponding to the doc in the LSP spec for each item? Tedious, but matching the spec is a simple policy and more field documentation is almost always better.
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.
-- <https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_prepareCallHierarchy>
data CallHierarchyItem = ...
Should it look like this? I have little knowledge about haddock.
It turns out I updated the capabilities following the compile errors/warnings. |
Ouch, that is unfortunate indeed, i was not aware of @banacorn plan neither 😟 |
@banacorn I added some missing tests after compared both solutions of you and me, thank you for your inspiration:) |
No, it's not your fault !! Anyway, my branch doesn't work. I was actually gonna make a PR and ask for help. |
I agree with this. @banacorn Out of curiosity, what do you mean about no call hierarchy response? I can navigate the call hierarchy on my client(VSCode) without any explicit configuration. |
@July541 that means it's just broken, as if no call hierarchy supported has been added. |
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.
Hi, I'm not too active here anymore but just chiming in here to say this looks great! Thanks for this PR and I hope you have a great summer of code :)
It seems #331 has the same confliction problem that failed on Windows with 8.10.4, I don't have any idea about it for the time being:( |
will try to take a look in my windows laptop |
it seems to be a dependency solver issue, related with |
I've got to build it adding to cabal.project
But i dont like the workaround |
ResponseResult TextDocumentPrepareCallHierarchy = Maybe (List CallHierarchyItem) | ||
ResponseResult CallHierarchyIncomingCalls = Maybe (List CallHierarchyIncomingCall) | ||
ResponseResult CallHierarchyOutgoingCalls = Maybe (List CallHierarchyOutgoingCall) |
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 think the Maybe
is not necessary
ResponseResult TextDocumentCallHierarchy = List CallHierarchyItem
ResponseResult CallHierarchyIncomingCalls = List CallHierarchyIncomingCall
ResponseResult CallHierarchyOutgoingCalls = List CallHierarchyOutgoingCall
List
should have that null
covered
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 just keep it to satisfy the spec. And I still notice that we have several dealings about null
, for example:
- Use
Maybe
to representnull
.ResponseResult TextDocumentHover = Maybe Hover
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_hover - Ignore
null
.
ResponseResult TextDocumentSignatureHelp = SignatureHelp
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_signatureHelp - Strictly follow the spec even like me it looks stupid.
ResponseResult WorkspaceWorkspaceFolders = Maybe (List WorkspaceFolder)
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_workspaceFolders
Maybe we need to unify them under one specific rule.
I dont like it but maybe can be applied to make progress until we have a proper solution |
Stupid question, but what is a Call Hierarchy? I couldn't figure it out from the spec, which just seemed to describe the protocol for it, not what the actual thing is. Edit: Oh, I just saw that the issue this PR is working on fixing explains it: haskell/haskell-language-server#738 |
As part of my GSoC 2021 works, this pr adds call hierarchy supporting according to lsp spec.