-
Notifications
You must be signed in to change notification settings - Fork 326
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
Reference codeLens action not working #495
Comments
The problem is very likely this:
since the LSP has no support (on purpose) for decoding VS Code URIs. Since you make this VS Code speicific in the first place (by using the VS Code command
LEt me know how it goes. |
Makes sense never thought of it that way.
But as lsp already has reference messages, can't we use them? Or do they
need to be called by the client? And that would be a protocol change?
…On Tue, Jun 11, 2019, 10:47 Dirk Bäumer ***@***.***> wrote:
The problem is very likely this:
{
"$mid": 1,
"path": "/home/razze/Development/elm-spa-example/src/Page/Article/Editor.elm",
"scheme": "file"
}
since the LSP has no support (on purpose) for decoding VS Code URIs. Since
you make this VS Code speicific in the first place (by using the VS Code
command editor.action.showReferences) you are better of handling this in
the VS Code extension. Options are:
- having you own command that then calls editor.action.showReferences
- implementing a VS Code LSP client middleware and send the URI as a
string and then convert it on the client side to a VS Code speicific URI
format.
LEt me know how it goes.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#495?email_source=notifications&email_token=ABNLEZD7K4YD2XACFZVL35LPZ5RBNA5CNFSM4HVLUOV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXMM73Y#issuecomment-500748271>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABNLEZA6KQY2SJRP7LBMWATPZ5RBNANCNFSM4HVLUOVQ>
.
|
You can of course call the |
Are there any docs on how to do this with vscode-languageserver-node? |
you have your own command and then implement a command handler on the VS Code side which then
|
You can also register middleware in Code’s client side to transform the types - example in PowerShell client - https://github.com/PowerShell/vscode-powershell/blob/master/src/session.ts#L366 |
@Krzysztof-Cieslak cool idea! |
Yes, this is pretty OK workaround... but I kinda believe this behaviour should be fixed here in |
@Krzysztof-Cieslak agree. Would require some spec in the LSP with some property to indicate that a code lens should trigger reference search. I don't want to standardize command id's in LSP. Then the VS Code implementation could trigger the command. PR welcome. |
Why? It should be really nice to have command IDs standardization, XML CodeLens references is a very good sample. We have this problem with our XML Language Server which which provides references for DTD, XSD. It works pretty well in vscode (call just LSP With standard command IDs, a lot of language server could benefit with standard commands (ex : click on references) without extra code. |
If we standardize this it must be more than a string ID to make it an explicit concept. And clients still need to announce which commands it supports. |
Yes sure it will require to specify ID + args command. It will give the capability to use standard structure for args on language server side. I think it can be a good idea.
Indeed and I think again it's a good idea because for XML Language Server we do that with custom capability. If we have standard capability, it should be cleaner. |
21: Upgrade frontend to work with Aya language server r=ice1000 a=imkiva Changes: - Add middleware to workaround microsoft/vscode-languageserver-node#495 - Provide light and dark colors for semantic highlight - Upgrade some dependencies Co-authored-by: imkiva <imkiva@islovely.icu>
424: New features to LSP r=ice1000 a=imkiva this PR upgraded LSP4j to 0.14 with inlay hints support; added some features to the LSP backend: - Inlay type hints for bind patterns (feel free to suggest more) - CodeLens of each definition showing `%d usages` - Code folding for definitions that occupy 3 or more LOC. - Search Everywhere in VSCode (symbols only since VSC does not ask more from backend) Try it: https://github.com/aya-prover/aya-vscode/suites/6895435995/artifacts/267446633 ## See also Language Server Protocol has recently upgraded to 3.17, and VSCode stabilized their inlay hints APIs - https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_inlayHint - rust-lang/rust-analyzer#11445 - microsoft/vscode-languageserver-node#495 - aya-prover/aya-vscode#21 Co-authored-by: imkiva <imkiva@islovely.icu>
I'm trying to use the build in command for
editor.action.showReferences
and have it bound to a codeLens. But I can't figure out, what I'm doing wrong.This is the error that happens, when I click the code action.
#210
https://github.com/elm-tooling/elm-language-server/blob/57550c1a0c95b74df3ecb71c98b261785a306c69/src/providers/codeLensProvider.ts#L79
The text was updated successfully, but these errors were encountered: