Skip to content

Highlight Dang 2.5 strings - #1

Merged
vito merged 1 commit into
mainfrom
dang-2.5-strings
Nov 12, 2026
Merged

vito merged 1 commit into
mainfrom
dang-2.5-strings

Conversation

@vito

@vito vito commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Updates the tree-sitter queries for Dang 2.5's string forms (vito/dang#300):

  • "..." and """...""" now interpolate ${expr} and process escapes
  • '...' and '''...''' are verbatim: no escapes, no interpolation
  • """ and ''' strings can carry a language tag, like backtick templates

The grammar adds the nodes string_content, interpolation, single_quote_string and triple_single_quote_string. The queries:

  • capture strings piecewise (quotes plus string_content), so interpolated expressions keep their own highlighting, and mark the ${/} delimiters
  • label language tags on """/''' strings and inject that language into the body, leaving ${...} regions as Dang
  • ignore indentation inside ''' strings, as for """

Depends on vito/dang#300: these queries need the grammar from that PR. The plugin installs the parser from vito/dang main (no pinned revision), so nothing needs bumping, but this shouldn't merge until that PR is on main.

The same queries are mirrored in vito/dang under editors/nvim/, where they were tested against the Neovim highlight corpus.

Dang 2.5 makes "..." strings interpolate with ${...}, adds verbatim
'...' and '''...''' strings, and lets """ and ''' strings carry a
language tag. Capture strings piecewise (quotes and string_content) so
interpolated expressions keep their own highlighting, mark interpolation
delimiters, label language tags, inject the tagged language into string
bodies, and ignore indentation inside triple_single_quote_string.

The tracked grammar on vito/dang main doesn't have these nodes yet;
the queries need the grammar from the open vito/dang PR.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit to vito/dang that referenced this pull request Nov 12, 2026
The highlight queries for Dang 2.5 strings land in vito/zed-dang#1 and
vito/dang.nvim#1. Point the submodules at those PRs' heads, so the
embedded copy of the Zed query and the Neovim highlight tests match the
grammar. Move them to the editor repos' main once those PRs merge.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito merged commit 3eec113 into main Nov 12, 2026
vito added a commit to vito/dang that referenced this pull request Nov 12, 2026
vito/zed-dang#1 and vito/dang.nvim#1 merged. Point editors/zed and
editors/nvim at their merge commits instead of the PR branches. The
queries are unchanged; zed-dang's merge also pins its grammar to
a075f90.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit to vito/dang that referenced this pull request Nov 12, 2026
vito/zed-dang#1 and vito/dang.nvim#1 merged. Point editors/zed and
editors/nvim at their merge commits instead of the PR branches. The
queries are unchanged; zed-dang's merge also pins its grammar to
a075f90.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit to vito/dang that referenced this pull request Nov 13, 2026
vito/zed-dang#1 and vito/dang.nvim#1 merged. Point editors/zed and
editors/nvim at their merge commits instead of the PR branches. The
queries are unchanged; zed-dang's merge also pins its grammar to
a075f90.

Signed-off-by: Alex Suraci <[email protected]>
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