Skip to content

grammars: Inject SurrealQL syntax in comment-labeled template literals in TypeScript/JavaScript - #63087

Open
luveti wants to merge 2 commits into
zed-industries:mainfrom
luveti:inject-surql-in-js-ts-strings
Open

grammars: Inject SurrealQL syntax in comment-labeled template literals in TypeScript/JavaScript#63087
luveti wants to merge 2 commits into
zed-industries:mainfrom
luveti:inject-surql-in-js-ts-strings

Conversation

@luveti

@luveti luveti commented Aug 22, 2026

Copy link
Copy Markdown

This is essentially a verbatim copy of: #55341

I would have preferred to quickly add this with a custom tree-sitter query via #46547

Description

Extends the existing ECMAScript comment-label injection system to support the SurrealQL language inside JS/TS strings and template literals.

The pattern /* language */ before a string is already used for html, sql, graphql, css, glsl and wgsl. This adds the same support for embedding SurrealDB SurrealQL queries as strings.

Syntax highlighting activates when the corresponding community extension is installed:

Both /*surql*/ and /* surql */ forms are accepted (same behavior as the existing patterns).

I've also added support for surql tagged template functions. Which is just a copy of the existing sql tagged template function injection.

Release Notes:

  • Added /*surql*/ comment-label syntax injection for JavaScript and TypeScript template literals
  • Added syntax injection for the surql JavaScript and TypeScript tag function

@cla-bot

cla-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @luveti 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'.

@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Aug 22, 2026
@luveti

luveti commented Aug 22, 2026

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 22, 2026
@cla-bot

cla-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

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

@SomeoneToIgnore SomeoneToIgnore added area:languages/typescript TypeScript programming language support area:languages/javascript JavaScript programming language support area:tree-sitter Syntax highlighting and tree-sitter labels Aug 22, 2026
@maxdeviant maxdeviant changed the title javascript, typescript: Inject SurrealQL syntax in comment-labeled template literals- #55341 grammars: Inject SurrealQL syntax in comment-labeled template literals in TypeScript/JavaScript Aug 25, 2026
@zed-industries-bot

Copy link
Copy Markdown
Contributor
Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against e521ed3

@luveti
luveti force-pushed the inject-surql-in-js-ts-strings branch from e521ed3 to 36260cf Compare August 26, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:languages/javascript JavaScript programming language support area:languages/typescript TypeScript programming language support area:tree-sitter Syntax highlighting and tree-sitter cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants