Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

LanguageClient-neovim + clangd support #23

Closed
theimpostor opened this issue Apr 21, 2020 · 2 comments
Closed

LanguageClient-neovim + clangd support #23

theimpostor opened this issue Apr 21, 2020 · 2 comments

Comments

@theimpostor
Copy link

With autozimu/LanguageClient-neovim#954 now merged, what remains for LanguageClient-neovim + clangd support? Using neovim and this plugin, highlighting doesn't appear to work out of the box. Is there more configuration required?

Thanks for the awesome plugin.

@jackguo380
Copy link
Owner

jackguo380 commented Apr 21, 2020

Hi, support for clangd (and other servers supported the proposed standard) is done entirely in LanguageClient-neovim, you don't need vim-lsp-cxx-highlight.

I realized I forgot to update the documentation for LanguageClient-neovim after autozimu/LanguageClient-neovim#954 got merged. But for reference I currently have the following configuration for clangd semantic highlighting:

let g:LanguageClient_semanticHighlightMaps['cpp'] = {
            \ 'entity.name.namespace.cpp': 'CppNameSpace',
            \ 'variable.other.field.cpp': 'CppMemberVariable',
            \ 'variable.other.enummember.cpp': 'EnumConstant',
            \ 'entity.name.function..*.cpp': 'Function',
            \ 'entity.name.type..*.cpp': 'Type',
            \ }

hi! CppNamespace ctermfg=Yellow guifg=#BBBB00 cterm=none gui=none
hi! CppMemberVariable ctermfg=White guifg=White

This is a fairly minimal configuration but should provide similar highlighting to what vim-lsp-cxx-highlight provides currently. Also note that clangd 10 and 11 provide more scopes than 9 such as ones for preprocessor (macros and skipped regions) which aren't in this configuration.

@theimpostor
Copy link
Author

OK that's great to hear, and thanks for the sample configs. I will close this issue.

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

No branches or pull requests

2 participants