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

Fix incorrect syntax highlighting for variables starting with "function" #992

Merged
merged 3 commits into from
Feb 17, 2022

Conversation

gowerc
Copy link
Contributor

@gowerc gowerc commented Feb 13, 2022

What problem did you solve?

Closes #982 - incorrect syntax highlighting for variables starting with the word function

  • Resolved by adding a negative lookahead to the function-declarations file to make sure there are no additional word characters following the function keyword
  • Added unit tests to show my code is working in the most basic settings
    • Unit tests work by reading in the regex pattern from the syntax file and then running them again pre-made strings.
    • Note that apparently vscode parses regex as POSIX but javascript doesn't so had to add a translation function.

Please let me know if there's a better way to test this or if you need me to refactor the code (am still learning node/ts/js/vscode).

(If you have)Screenshot

image

@gowerc
Copy link
Contributor Author

gowerc commented Feb 13, 2022

Looks like the unit tests have failed with:

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

I'm assuming this is because the environment variable process.env.EXTENSION_ROOT isn't getting populated. I'm then guessing that this means the CICD job isn't using the same launch configuration as is being used by testing in vscode ?

@gowerc gowerc changed the title closes #982 Fix incorrect syntax highlighting for variables starting with "function" Feb 13, 2022
@gowerc
Copy link
Contributor Author

gowerc commented Feb 16, 2022

@renkun-ken , fixed the bug with pathing for getting the config file, this is ready for review now. Please let me know if there is a better way of handling this.

Copy link
Member

@renkun-ken renkun-ken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@renkun-ken renkun-ken merged commit 4ba871c into REditorSupport:master Feb 17, 2022
@gowerc gowerc deleted the fix-function-syntax branch September 6, 2023 13:10
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.

wrong symbol recognition when variable name starts with function
2 participants