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

Support for C/C++ semantic highlighting. #1873

Closed
wants to merge 4 commits into from
Closed

Conversation

davits
Copy link
Contributor

@davits davits commented Jan 2, 2016

For testing purposes only.

Continuation of pull request ycm-core/ycmd#291

For now, each time when new tokens are received I'm cleaning old matches and adding new ones. This is a quick/dirty solution.
Vim doesn't have effective mechanism for semantic highlighting. The matchaddpos() function I'm using has several "issues":

  1. Added matches are staying at their absolute positions, and when user types, it messes up all the highlighting. One should wait for reparse to finish to normalize tokens. This may be frustrating...
  2. Vim stores matches in a linked list, so adding/managing all the tokens at once may slow things down in the big files with lots of tokens. (Though I haven't tested this scenario yet)

Review on Reviewable

For testing purposes only.
@Valloric
Copy link
Member

Valloric commented Jan 2, 2016

The performance aspect of Vim handling semantic highlighting is one of the main reasons why I don't think we should tackle it. I'm not convinced such a feature could be added in any performant way in Vim, purely because of Vim's misdesigns.

@puremourning @vheon @micbou

Davit Samvelyan added 3 commits January 4, 2016 01:25
Added callback registration mechanism which allows notify semantic
highlighting plugin about token readiness.
@davits
Copy link
Contributor Author

davits commented Jan 12, 2016

Closing this PR to split it into smaller pieces.

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

Successfully merging this pull request may close these issues.

None yet

2 participants