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

Semantic highlighting? #34

Open
levihb opened this issue Sep 3, 2020 · 3 comments
Open

Semantic highlighting? #34

levihb opened this issue Sep 3, 2020 · 3 comments

Comments

@levihb
Copy link

levihb commented Sep 3, 2020

Is there no support for semantic highlighting like omnisharp-vim has? Or is some extra configuration needed? Because I don't have any, I only have the defaultt csharp highlighting that comes with vim.

@yatli
Copy link
Member

yatli commented Nov 20, 2020

Waiting for the semantic token lsp proposal to finalize, and the implementation in coc.nvim :)

@levihb
Copy link
Author

levihb commented Nov 20, 2020

Thank you, I currently run with both this and omnisharp-vim, effectively running two versions of the server. Which is fine as it doesn't cause any performance problems. But I'd much rather be able to run just this. The other problems I have are:

I can't jump to the definition/type/etc if it's another library. With omnisharp-vim I can jump to e.g. .NET code and it gives me the function signature at minimum with documentation, or if it's available the full source. E.g. if I use go to definition on string I get:

mslib

Can this be added?

Function signatures just don't work? If I start filling out a function like new MyClass( then all completion just disappears? But if we look at coc-python it gives you the parameter you're on and its name. I mean this would make even more sense with C# and you could show more information because it's statically and strongly typed unlike python. I assume coc has support for this as coc-python has it? E.g. this is what I mean:

coc-python-completion

The code actions don't seem to be working with this addon? When I use:

autocmd FileType cs nnoremap <buffer> Krr :OmniSharpGetCodeActions<CR>

I get code actions just fine from omnisharp-vim, but then if I use the following:

nmap Krr <Plug>(coc-codeaction)

I don't get anything? I just get an error of [coc.nvim] CodeAction not found. Even though it's in the exact same position as the omnisharp-vim one? I also get this message very quickly. I'm not sure why?

coc-codelens-action doesn't seem to work either? Despite the fact that I can see things like "1 reference" at the end of the line.

coc-type-definition doesn't work either? I just get [coc.nvim] Type definition provider not found for current document instead of being taken to the type definition.

coc-implementation doesn't work? I can use OmniSharpFindImplementations with omnisharp-vim. But with this I get a similar error to above, with Implementation provider not found for current document.

coc-declaration doesn't work, again no provider found.

A minor one but it doesn't appear as if the usings sorting or deletion functionality exists? With omnisharp-vim there is OmniSharpFixUsings.

Another minor one. With omnisharp-vim you can find the type of the variable you're under with OmniSharpTypeLookup. Which can be very useful, especially with things like var. Is there any sort of supported way of showing this with coc?

Also finally I've had issues with omnisharp on both addons, so I had to compile it myself (which makes more sense as well as I can point them both to the same place then instead of having two versions of omnisharp). I know that someone added in the ability to use the custom path for this addon. But it's not in version you can download directly with coc? I had to compile it myself to get that, and I had a few issues doing that as the version number hadn't been changed either. I assume this isn't actually a problem and you're just waiting for other features to add for a larger release? But I thought I should bring it to your attention in case it is meant to be added.

Thank you again. Could you possibly address the above points for me? I'll also try and find some time to contribute to the project.

@yatli
Copy link
Member

yatli commented Nov 20, 2020

I can't jump to the definition/type/etc if it's another library.

We can probably do this in coc-utils -- my coc-fsharp plugin also has this problem. Would be super cool if it can download the source on the fly, or at least give us a definition buffer.

Have a look at my vimrc: https://github.com/v-yadli/vimrc/blob/eb8fca1905262885a64ae82399cab8377be4d8e1/vsim.vim#L423

Function signatures just don't work?

CocActionAsync('showSignatureHelp') -- you can bind it to autocmd CursorHoldI and it will pop up automatically.

For the code action, coc-declaration, coc-implementation stuff, try get the latest version (0.27) and then download the language server again -- it's improved a few days ago.

Another minor one. With omnisharp-vim you can find the type of the variable you're under with OmniSharpTypeLookup. Which can be very useful, especially with things like var. Is there any sort of supported way of showing this with coc?

nmap <silent> <buffer> <S-K> :call CocActionAsync('doHover')<CR>

Also, for the o# version thing... Just wait for new releases, the version is not hard coded in coc-omnisharp. It finds the latest version.

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

No branches or pull requests

2 participants