Skip to content
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

Method textDocument/documentColor not supported #13

Closed
bafto opened this issue Jun 28, 2022 · 3 comments · Fixed by #14
Closed

Method textDocument/documentColor not supported #13

bafto opened this issue Jun 28, 2022 · 3 comments · Fixed by #14

Comments

@bafto
Copy link
Contributor

bafto commented Jun 28, 2022

It seems like glsp does not implement this method?

I used the minimal example, added textDocument sync methods (like open close etc), and then wanted to do simple color highlighting of some keywords in my language.
So I implemented the and added the functions TextDocumentColor and TextDocumentColorPresentation to the protocol.Handler, but vscode gives me the error message

Request textDocument/colorPresentation failed.
    Message: method not supported: textDocument/documentColor
    Code: -32061

I looked into the source code of this package and infact it implements method textDocument/color and not textDocument/documentColor as stated in the specification

It is likely that this is an Issue in my code, but maybe it is in the package.
Can you look into it? Maybe it is just a typo in textDocument/color which should have been textDocument/documentColor.

@bafto
Copy link
Contributor Author

bafto commented Jun 28, 2022

Ok, I forked your repo and changed line 2077 in language-features.go from "textDocument/color" to "textDocument/documentColor" which fixed my issue.
Can you fix this? Or should I make a pull request?

@tliron
Copy link
Owner

tliron commented Jun 28, 2022

It looks like you found a bug. So, the nice thing to do would be to fix it for everyone. :) If you are confident in the fix, please do make a pull request! Thanks in advance!

@bafto
Copy link
Contributor Author

bafto commented Jun 28, 2022

I created a pull request.
It is a one-line fix, so you might not need to review it, but maybe do it to be sure? Up to you, but it should not break anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants