tliron / glsp

Language Server Protocol SDK for Go
Apache License 2.0
165 stars 22 forks source link

Method textDocument/documentColor not supported #13

Closed bafto closed 2 years ago

bafto commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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.