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

Next #32

Merged
merged 21 commits into from
Mar 23, 2024
Merged

Next #32

merged 21 commits into from
Mar 23, 2024

Conversation

braver
Copy link
Collaborator

@braver braver commented Mar 17, 2024

  • Consistently renamed the package to Twig.
  • Snippet triggers no longer prefixed with "t".
  • Add missing indent rule for elseif.
  • Improved support for filters.
  • Object properties now have the correct scope.
  • More detailed matching in for loops.
  • Recognizes variable declarations, supporting goto definition and symbol list.
  • Support arrow functions, range, spread operators, the only keyword, etc. etc..
  • More detailed matching of test statements ("... is bar").
  • More detailed matching of filters, allowing more context-aware completions.
  • Consistent with Twig's documentation, {% %} is now scoped as meta.statement,
    {{ }} as meta.expression.
  • Scopes of the parent context are now completely cleared,
    ensuring clean highlighting of Twig statement not matter where it's inserted.
  • Add many more tests and handle more expressions with more detail.
  • Updated CI setup for up to date tests on the latest Sublime Text builds.

also fixes #28

braver and others added 21 commits March 17, 2024 20:23
- the package is, within Sublime Text and Package Control, now
  consistently named Twig.
- add manual installation instruction (with correct name/dir)
- completions will change in upcoming changes, removed that from readme
no longer start with "t", so you can simply type, e.g. "if" and hit tab
to insert the snippet

- snippets are now presented as completions if you partially typed one
- add a few missing tags
this package doesn't have files large enough to worry about ignoring
and renamed them to remove the package name prefix
ensuring we cover all documented structures
based on new and more detailed tests,
covering all documented twig expressions at twig.symfony.com

mainly with the goal of adding detail, e.g.:
- to provide _filter_ completions where filters may be used
- provide _test_ completions where tests may be used (ie. after "is")
- improved recognition of various keywords and operators
- recognize built-in functions, filters, etc
  but also fully support custom versions
- handle filters that may take (optiona) arguments
- recognize where variables are declared to support goto definition

additionally: always clear scopes when embedded
to ensure the twig expression itself is highlighted without the parent
context interfering (ie. not just inside strings)
add test againt 4107
@braver braver merged commit d26ab0b into master Mar 23, 2024
3 checks passed
@braver braver deleted the next branch March 23, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Wrong scope when in HTML script/style tags
1 participant