Skip to content

Adjust some scopes in Sublime Syntax Definitions#433

Open
deathaxe wants to merge 4 commits into
masterfrom
pr/fix/context-reference-scope
Open

Adjust some scopes in Sublime Syntax Definitions#433
deathaxe wants to merge 4 commits into
masterfrom
pr/fix/context-reference-scope

Conversation

@deathaxe
Copy link
Copy Markdown
Member

@deathaxe deathaxe commented May 14, 2026

This PR proposes to...

  1. introduce unique scopes for context, branch_point and global variables.

    • variable.other.branch_point - branch point references
    • variable.other.constant - global variables
    • variable.other.context - context names

    Goal: Plugins, snippets and completions should be able to address all of them easily.

  2. scopes {{...}} expressions meta.interpolation instead of keyword.other.variable.

  3. change scope of context name from entity.name.function to entity.name.class

    to ensure Goto Symbol quick panel displays c kind icon, as auto-completion popup does.

    The completion items' kind icon is changed to use KIND_ID_TYPE, to ensure both,
    Goto Symbol quick panel and auto-completion popup display c with same color.

    Goal: Better visual consistency.

deathaxe added 4 commits May 14, 2026 17:42
This commit assigns a unique scope to context name references (e.g. includes)
to distinguish them from branch-point references and normal variables.
This commit scopes global variables `variable.other.constant` so all variables
are scoped with a 3rd-level scope. `.constant` is chosen as it is a default one
and global variables are read-only.
This commit scopes context names `entity.name.class.context` to align kind icon
in 'Goto Symbol' quick panel with that from completion popup.

Completions' KIND_ID is adjusted to ensure both panels display `c` with same
color.

Note: Choosing a right scope is the only way to adjust the kind icon.
This commit replaces `keyword.other.variable` by `meta.interpolation`
as it is the more appropriate scope for `{{...}}` expressions,
with regards to various template languages.
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.

1 participant