-
Notifications
You must be signed in to change notification settings - Fork 25
Missing highlight on some keywords #3
Comments
Unfortunately this isn't a bug in vim-lsp-cxx-highlight. ccls/cquery do not send keywords in the semantic highlighting information. I believe this is correct behavior since these keywords can be statically highlighted by regexes, sending them over LSP would introduce unnecessary overhead. The issue you are running into is that Vim's own C++ syntax highlighting isn't very good. Notably many C++ keywords like |
Thank you for your answer. Using vim-cpp-modern in conjunction with your plugin seems to give pretty good results, it might be worth it to specify that not all symbols are treated by lsp-cxx-highlight by design in the wiki/readme/doc. If it's there and I've missed it, my bad. As I said I still have some symbols other than keywords that are not highlighted properly, albeit with similar symptoms. Do you want another issue on the matter ? |
Ah sorry I missed that part about templates. I have seen that as well and suspect it's due to ccls missing some template parameters in its index since I don't see the same issue using cquery. I was planning on filing a issue myself as well, but it would be great if you could dig more into this. No need to make a new issue, using this one is okay. Edit: |
Looks like template parameters will be highlighted if you build with LLVM 9 (currently in development), see this issue I posted: MaskRay/ccls#364. |
When writing the following example, the only recognized token is the class name
test
, which gets properly highlighted as a type:template<typename T> class test {};
The
template
,typename
andclass
keywords are not recognized. This is true whether the class is templated or not. This is true for most c++ keywords/qualifiers such asstruct
,const
, etc.LspCxxHlCursorSym command yields no results for these keywords, and the LspCxxHlIgnoredSyms returns an empty list.
I am unsure whether this is an issue with LspCxxHl or the intended design for the plugin to rely for some part on the default c.vim highlight groups, in which case I assume I should modify some highlight bindings (which ones?) to better differentiate between types and keywords as it is visible in your example image.
I have some more examples of seemingly silently ignored symbols (the template parameter in my previous example is one), tell me if you want a different issue for these. I can provide my log if you're interested.
The text was updated successfully, but these errors were encountered: