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

enh(nsis) improve highlighter rules and tests #3822

Closed
wants to merge 6 commits into from

Conversation

idleberg
Copy link
Contributor

@idleberg idleberg commented Jul 16, 2023

I have identified several highlighting issues and reported them #3821. In my memory, these inconsistencies did not exist in earlier versions, but I could be wrong.

This PR adds some tests to identify the problems Obviously, the highlighting rules need to be updated before a merge, so I consider this PR work in progress.

Specifically, I tried adding block-keywords such as !macro / !macroend to the beginKeywords block, but this did not solve the problem. Could the exclamation mark, as a non-word character cause this problem? Also, defining !macroend before the !macro keyword did not have an effect. I'm looking for some direction on how to tackle these issues!

Changes

  • ✅ add test for macro definitions
  • ✅ add test for runtime condition
  • ✅ fix expected markup for !ifdef keyword
  • ✅ fix issues caused by manual editing
  • ✅ remove unused import

Todo

  • identify and write missing test cases
  • fix specific highlighter issues

Checklist

  • Added markup tests, or they don't apply here because...
  • Updated the changelog at CHANGES.md

@joshgoebel
Copy link
Member

joshgoebel commented Jul 18, 2023

Could the exclamation mark, as a non-word character cause this problem?

Yes, if using keywords you need to redefine the keyword pattern, see keywords.$pattern in the docs (or source). Such as:

    keywords: {
      $pattern: '[a-zA-Z][a-zA-Z0-9_$%!#]*',
    },

@joshgoebel
Copy link
Member

Closing for inactivity, but we can reopen anytime you have time to revisit this work.

@joshgoebel joshgoebel closed this Mar 21, 2024
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.

None yet

2 participants