Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
All new code requires tests to ensure against regressions
Description of the Change
This PR updates variables scope to restrict it to the word boundaries. This fixes the case when anything that could potentially match a variable declaration would break syntax highlighting, for example, myVar instanceof MyClass would result being highlighted as my[Var instanceof MyClass] where [..] would become a part of variable declaration.
I generalised the word boundary (\b) check to make sure we never match variable declaration halfway through, particularly for usages of instanceof.
Alternate Designs
None were considered.
Benefits
Fixes the issue of highlighting instanceof.
Possible Drawbacks
This might break certain usages of variable declarations.
Requirements
Description of the Change
This PR updates
variables
scope to restrict it to the word boundaries. This fixes the case when anything that could potentially match a variable declaration would break syntax highlighting, for example,myVar instanceof MyClass
would result being highlighted asmy[Var instanceof MyClass]
where[..]
would become a part of variable declaration.I generalised the word boundary (
\b
) check to make sure we never match variable declaration halfway through, particularly for usages ofinstanceof
.Alternate Designs
None were considered.
Benefits
Fixes the issue of highlighting
instanceof
.Possible Drawbacks
This might break certain usages of variable declarations.
Applicable Issues
Fixes #229