-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Preprocessor-based folding #2688
Comments
I'd love that! In addition to folding a specific highlight group could also be set. So the code that is not defined is marked as e.g. a comment. |
This, along with other semantic highlightng, is aleady implemented in dyevim, which uses a fork of YCM. So you do get the benefit of single compile for all of the features upstream YCM has plus semantic highlighting. |
Ah, nice. Thx for pointing that out. |
dyevim has fallen out of sync with ycm (not surprising). Can we accomplish something like this with clangd or another c++ lang server ? |
Here's a little bit of history. What I didn't mention above, is that the creator of dyevim made a PR to upstream the changes. #1873 ycm-core/ycmd#291 Now this was long before LSP was a thing. Today, if this feature would be implemented, thinks would be much different:
But before that, we need the protocol to support this.
Note that ccls is capable of semantic highlighting as a protocol extension, but I don't think we should migrate to a different server over an unofficial protocol extension. |
makes sense - thanks for the update/background info. |
Neither folding nor semantic completion are currently considered to be in scope for YCM. |
This is just an idea, but could YCM communicate preprocessor conditions to vim as folding hints? e.g. if I have a
#ifndef FOO
section, and it's defined in the flags in the YCM config file, could vim automatically add a collapsed fold for that? I know this isn't the primary goal of YCM, but since it already has all the heavy machinery to parse the file asynchronously with the right flags, it seems like a good place to add that functionality.The text was updated successfully, but these errors were encountered: