Skip to content

feat(sql): semantic tokens for db blocks via the SQL grammar#33

Merged
gandarfh merged 1 commit into
mainfrom
feat/sql-semantic-tokens
Jun 16, 2026
Merged

feat(sql): semantic tokens for db blocks via the SQL grammar#33
gandarfh merged 1 commit into
mainfrom
feat/sql-semantic-tokens

Conversation

@gandarfh

Copy link
Copy Markdown
Member

Phase 2 of SQL support: the language server now emits semantic highlight
tokens for db-* blocks by walking the SQL CST (Phase 1 grammar).

  • New Semantic_tokens.kinds: Sql_keyword/Sql_identifier/Sql_string/
    Sql_number/Sql_comment.
  • sql_tokens walks the CST and colours only leaf nodes (keyword_*,
    identifier, string/number literals, comments); structural nodes are
    skipped so tokens never overlap. Ref spans are carved out like HTTP does.
  • body_tokens dispatches by fence lang: http -> HTTP tokens, db-* ->
    SQL tokens.
  • LSP legend + type_index extended; SQL kinds downgrade to the standard
    LSP token types (keyword/variable/string/number/comment).
  • Tests: 7 new (keyword/identifier/number/string/comment emitted, doc-
    absolute offsets, http emits no sql tokens); adjusted 2 protocol tests
    whose legend indices shifted. 140 pass, 0 fail.

No desktop change yet (the desktop keeps its lang-sql first-paint); wiring
the LSP SQL tokens into CM6 lands with a later release.

@gandarfh
gandarfh merged commit 960a1f8 into main Jun 16, 2026
9 checks passed
@gandarfh
gandarfh deleted the feat/sql-semantic-tokens branch June 16, 2026 18:13
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