Skip to content

Allow themes to style Vue directives separately#103

Merged
MrSubidubi merged 3 commits intozed-extensions:mainfrom
icarusgk:patch-1
Mar 18, 2026
Merged

Allow themes to style Vue directives separately#103
MrSubidubi merged 3 commits intozed-extensions:mainfrom
icarusgk:patch-1

Conversation

@icarusgk
Copy link
Contributor

@icarusgk icarusgk commented Mar 6, 2026

This changes the tree-sitter capture for Vue directive names (v-if, v-model, v-for, etc.) from @keyword to @keyword.directive.

Motivation

Currently, Vue directives like v-if and v-model are captured as @keyword, making them visually identical to HTML attributes, not that there's something wrong with that but because they're being captured as @keyword it makes it impossible for themes to style them differently, and they often need to style the attributes differently in order for the directives be styled differently.

@keyword.directive is already used by other languages for similar constructs (e.g., preprocessor directives). With this change, theme authors can distinguish Vue template directives from language-level keywords.

Breaking changes?

None! Themes that don't define keyword.directive will fall back to keyword styling, so this is a non-breaking change for existing themes.

@cla-bot
Copy link

cla-bot bot commented Mar 6, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @icarusgk on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@icarusgk
Copy link
Contributor Author

icarusgk commented Mar 6, 2026

@cla-bot check

@cla-bot cla-bot bot added the cla-signed label Mar 6, 2026
@cla-bot
Copy link

cla-bot bot commented Mar 6, 2026

The cla-bot has been summoned, and re-checked this pull request!

MrSubidubi
MrSubidubi previously approved these changes Mar 18, 2026
Copy link
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.

Thanks! And congrats to your first contribution! 🎉

@MrSubidubi MrSubidubi enabled auto-merge (squash) March 18, 2026 17:23
@MrSubidubi MrSubidubi merged commit 836b355 into zed-extensions:main Mar 18, 2026
5 checks passed
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