Skip to content

Fix @ symbol highlighting in Dart annotations#73

Merged
MrSubidubi merged 2 commits intozed-extensions:mainfrom
tsinis:fix/dart-annotation-at-symbol-highlighting
Apr 17, 2026
Merged

Fix @ symbol highlighting in Dart annotations#73
MrSubidubi merged 2 commits intozed-extensions:mainfrom
tsinis:fix/dart-annotation-at-symbol-highlighting

Conversation

@tsinis
Copy link
Copy Markdown
Contributor

@tsinis tsinis commented Mar 22, 2026

Hey Team!

Reference to (part of) the Issue: #29

  • The @ symbol in annotations (e.g. @override, @Deprecated()) was highlighted as an operator while the annotation name received @attribute styling, making them appear as two visually distinct tokens
  • Capture @ as @attribute inside the annotation rule and remove it from the operators block
  • Reorder annotation rules after the generic uppercase @type pattern so that @attribute takes final precedence for names like Deprecated

Before:

Screenshot 2026-03-22 at 22 49 29

After:

image

…ator

The `@` symbol in Dart annotations (e.g. `@override`, `@Deprecated()`) was
highlighted as an operator, making it visually distinct from the annotation
name which received `@attribute` styling. This made annotations appear as
two separate tokens instead of a single semantic unit.

- Capture `@` as `@attribute` inside annotation rules
- Remove `@` from the operators block
- Move annotation rules after the generic uppercase identifier pattern
  so `@attribute` takes precedence over `@type` for names like `Deprecated`
Copy link
Copy Markdown
Contributor

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

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

Very nice, thank you for looking into and fixing this! And thanks for providing screenshots upfront!

@MrSubidubi MrSubidubi merged commit b1da3af into zed-extensions:main Apr 17, 2026
5 checks passed
@tsinis tsinis deleted the fix/dart-annotation-at-symbol-highlighting branch April 17, 2026 09:22
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.

2 participants