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

Some blacklist keywords being ignored on some files #46

Open
jevogel opened this issue Feb 25, 2016 · 2 comments
Open

Some blacklist keywords being ignored on some files #46

jevogel opened this issue Feb 25, 2016 · 2 comments

Comments

@jevogel
Copy link

jevogel commented Feb 25, 2016

I'm working with VHDL and I added about 120 VHDL keywords to the blacklist file. On some files they all seem to be correctly blacklisted and will use the highlighting specified in the color scheme, but on other files some of the keywords will be semantically-highlighted. It varies between files which keywords are handled correctly and which are not. Rebuilding the color cache doesn't seem to help.

I have a feeling it might have something to do with the plugin not excluding comments from matching, as it seems to happen only in files with lots of wordy comments. I looked at the cache file and noticed there were a lot of words in there that didn't look like my variables. I also noticed that there were no listings in the cache for my blacklisted keywords, which is what I would expect.

@faceleg
Copy link
Collaborator

faceleg commented Apr 7, 2016

In order to have someone debug this, we'll need some example files

@jevogel
Copy link
Author

jevogel commented Apr 7, 2016

This example has a fair number of comment lines.
This is a list of VHDL keywords similar to what I was using.

This example file doesn't have as many comments as the files I was dealing with, but you could always add more (the more words, the better... could try adding "lorem ipsum").

If you run the plugin on this file and then check the cache, you should see that words from the comments show up there. I suspect that if the comments are wordy enough, you will note that some keywords will be highlighted when they should not be.

My stopgap fix for this was to modify the regex used to identify variable names to exclude comments. Perhaps you could modify the regex such that it accepted an argument that defined the comment characters for the current language. Of course, dealing with block comments would be a whole 'nother issue.

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

No branches or pull requests

2 participants