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

Properties that are keywords cause cascading highlighting issues #67

Open
tandrewnichols opened this issue Oct 3, 2017 · 4 comments
Open

Comments

@tandrewnichols
Copy link

I also use vim-javascript for my normal syntax highlighting. However, I've tried commenting out this library in my setup and I don't see the bug, so something here clashes with the setup there. Without this library, vim-javascript correctly does not highlight javascript keywords used as object properties, like obj.class = 'success'. With this library, class gets highlighted according to the syntax highlighting specified by vim-javascript (which is to say, it's the same color "class" would be when used as a class declaration). That by itself isn't really a problem; I could live with it. The problem is that subsequent text is then highlighted erratically because this library seems to think it was an actual class declaration and is expecting the class itself to follow. Here's a screen shot. Note how "MemberService.member.personal.firstname" is yellow. Without this library, it's white, as I'd expect for any object property path.

screen shot 41

@lararosekelley
Copy link

Related - strings are highlighted incorrectly if they contain keywords, such as the library names themselves

screen shot 2017-11-25 at 3 37 04 pm

@tandrewnichols
Copy link
Author

Comments too:

screen shot 11

@othree
Copy link
Owner

othree commented Apr 2, 2018

I think these are two different issue.
The first one I am not sure what is the root cause.

The word highlighted in comment and string is because the syntax of vim-javascript use incorrect(or not following convention) group name.

@tandrewnichols
Copy link
Author

tandrewnichols commented Dec 10, 2018

The first issue has something to do with postprocess.javascript.vim. If I make it not source that file, I don't get syntax highlighting errors with class, but I also don't get library function highlighting on chained functions. Like

angular.module('app').controller

Here angular and module are correctly highlighted but controller is not. And btw, this particular issue is unaffected by vim-javascript. If I remove that from my plugins, I still get these errors on things like .class.

You are correct that the second issue is a discrepancy between this library (which expects things called, e.g., javascriptComment and vim-javascript which is naming them jsComment.

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

No branches or pull requests

3 participants