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

[Groovy] refactor #4193

Draft
wants to merge 34 commits into
base: master
Choose a base branch
from
Draft

[Groovy] refactor #4193

wants to merge 34 commits into from

Conversation

jrappen
Copy link
Contributor

@jrappen jrappen commented Mar 14, 2025

  • re-write syntax
    • bump syntax to v2, replace pop: true with pop: 1
    • move syntax variables to EOF
    • test base scope in syntax test file
    • make capturing groups non-capturing where applicable
    • add section markers to syntax file
    • move wordlists in matches to their own variable
    • fix shebang scope & add tests
    • fix regexp in slashy strings
  • fix metadata
    • add scope-pairs to fold settings
  • add default language settings
  • add default keymaps
  • add build files

Co-authored-by: deathaxe [email protected]
Co-authored-by: Keith Hall [email protected]
Co-authored-by: Michael B. Lyons [email protected]

jrappen added 7 commits March 14, 2025 09:49
- test base scope in syntax test file
- bump syntax to v2, replace `pop: true` with `pop: 1`
- move syntax variables to EOF
- make capturing groups non-capturing where applicable
- add section markers to syntax file
@jrappen jrappen changed the title [Groovy] refactor: [Groovy] refactor Mar 14, 2025
@michaelblyons
Copy link
Collaborator

michaelblyons commented Mar 14, 2025

@jrappen
Copy link
Contributor Author

jrappen commented Mar 14, 2025

I'll take a look through your suggestions later, got most on my TODO anyway. Going step-by-step with the free time I have.

scope: storage.type.primitive.float.32bit.groovy
- match: \bdouble(?:\b|(?:\[\s*\])*\b)
- match: \bdouble(?:\b|{{optional_arrays}}\b)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do the optional arrays have \b at the end? Won't that basically never match?

Copy link
Contributor Author

@jrappen jrappen Mar 17, 2025

Choose a reason for hiding this comment

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

That's what the match had before this PR where it matched all "primitive types"-words.

I haven't looked into every single match in the syntax, yet. Started with tearing apart word-lists to add more granular scopes.

Pretty sure this isn't the only one that currently doesn't work.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right. I know this wasn't your doing. Just wanted to flag. 🙂

@jrappen jrappen mentioned this pull request Mar 25, 2025
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants