Fix syntax highlighting for "var" keyword #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "var-highlighting"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I discovered that the newly introduced "var" keyword does not have proper syntax highlighting in Java despite the grammar supporting it.
It seems that it's not being highlighted as a
typeNamelike the rest of the type names (e.g.int,long, etc) are. I think adding it to the list ofsimpleTypesshould do the trick. We can also remove the union type in the local variable declaration since that would be made redundant. I'm new to Lezer grammars so please let me know if something looks off!It looks like the
vartoken parses fine but was just forgotten insrc/highlight.js. Is there any reason you ended up changing the grammar instead of adding it there that I am missing?ahh I see. I thought it was technically more correct to classify it as a
simpleType, which also conveniently simplifies the grammar, but happy to update the syntax highlighting spec insteadlet me know if the latest commit looks better! wasn't sure what the best way to classify it is in the style spec but I figured matching the primitive types (standard typeNames) was most fitting
I'd go with
definitionKeyword. Does that work for you?yep sounds good. done!