sublimelsp / LSP-OmniSharp

Convenience plugin to install/update OmniSharp for LSP
MIT License
20 stars 10 forks source link

`documentHighlightProvider` capability #24

Open ssoher opened 1 year ago

ssoher commented 1 year ago

I find it useful when other occurances of the symbol under the caret are highlighted, makes it easy seeing the immediate usages. But this doesn't seem to work in LSP-OmniSharp even when I change document_highlight_style to background and add the related scopes with custom background colors to my color theme (using this as a guide https://lsp.sublimetext.io/customization/#document-highlights).

Do we have the required capability in the server, am I doing something wrong?

rwols commented 1 year ago

If you open the LSP log panel with “LSP: Toggle Log Panel”, then you can see what capabilities the server has exactly by looking at the response of the initialize request

rwols commented 1 year ago

Maybe easier: run view.run_command("lsp_dump_buffer_capabilities") in the ST console when you have a .cs file open.

ssoher commented 1 year ago

@rwols I can't feel sad now that the answer is no since I've also learned something, thanks :)

Can we consider this "issue" a feature request then?

rwols commented 1 year ago

It seems JoeRobich added it just 18 days ago: https://github.com/OmniSharp/omnisharp-roslyn/blob/c214d900ca250556bb09156fcb2b27d217a3a523/src/OmniSharp.LanguageServerProtocol/Handlers/OmniSharpDocumentHighlightHandler.cs

rwols commented 1 year ago

But maybe it's just a placeholder, I haven't looked much into it: https://github.com/OmniSharp/omnisharp-roslyn/pull/2463

rwols commented 1 year ago

v1.39.2 should contain that functionality: https://github.com/OmniSharp/omnisharp-roslyn/releases/tag/v1.39.2

rwols commented 1 year ago

While we use v1.38.2: https://github.com/sublimelsp/LSP-OmniSharp/blob/1afed47ed5aebc692c6c69220c80ce79b9cebc0f/plugin.py#L15

ssoher commented 1 year ago

I can confirm that replacing the packaged omnisharp version with the latest release 1.39.2 does provide highlighting.