Repository navigation
Conversation
Runtimes now only honor `<<<dotprompt:{nonce}:...>>>` markers carrying the
per-render nonce, so a literal `<<<dotprompt:role:system>>>` in a template
renders as plain text. Editor tooling still inserted that form (vscode
`<<<` snippet) and highlighted it as live syntax, teaching a form that
silently does nothing.
- Remove the raw-marker snippet and the marker rule/token/node from the
vscode tmLanguage, monaco, codemirror, vim, emacs, jetbrains and
tree-sitter grammars (parser regenerated with tree-sitter-cli 0.22.6,
corpus test now expects plain text).
- Role and section snippets, completions, live templates and hover docs
now insert the inline helpers (`{{role "system"}}`, `{{section "x"}}`).
The block forms they used (`{{#role}}...{{/role}}`) discard their
content, since `role` and `section` never call `options.fn`.
- Drop stray `{{/section}}` lines from the monaco/codemirror samples.
- Update READMEs and the vscode CHANGELOG (Unreleased) accordingly, and
default snippet models to gemini-flash-latest.
apascal07
approved these changes
Nov 18, 2026
The JetBrains lexer never emitted HANDLEBARS_HELPER or HANDLEBARS_VARIABLE,
so once the raw marker token was removed nothing Dotprompt-specific was
highlighted. It now lexes inside `{{ }}` in the template body: helper names
in helper position (built-ins and role/history/section/media/json/
ifEquals/unlessEquals), variables and paths, and `}}`/`~}}`/`}}}` closers.
The expression state is encoded in the lexer state, and getState() now
reports the state at the token start so incremental relexing resumes
correctly. Adds a Bazel kt_jvm_test for the lexer.
CodeMirror helper completions used string `apply` values, which replace the
typed word verbatim, so `{{ro` + `role` produced
`{{{{role "${role}"}}`. They are now snippets that start at the helper
name, use real fields, and replace an auto-closed `}}` instead of doubling
it. Monaco had the same doubling (empty replace range at the cursor); its
insert texts and ranges are fixed the same way. Adds vitest coverage for
the CodeMirror completion source.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's new
Editor tooling stops suggesting and highlighting raw
<<<dotprompt:...>>>markers and inserts the template helpers instead.<<<raw-marker snippet; role/section insert the inline helpers ({{role "system"}},{{section "output"}}), alongside{{history}}and{{media url=...}}.<<<dotprompt:...>>>is plain text now. Tree-sitter parser regenerated with the pinnedtree-sitter-cli0.22.6; corpus test updated.{{#role}}...{{/role}}/{{#section}}removed from suggestions: the helpers never calloptions.fn, so block content was silently dropped.{{ }}: helper names (role,history,section,media,if,each, ...) are highlighted as helpers, other identifiers/paths as variables,}}as a close brace. Previously only the (now removed) marker token was Dotprompt-specific. Lexer unit tests added (bazel test //packages/jetbrains:DotpromptLexerTest).{{were inserting literal text ({{ro+roleproduced{{{{role "${role}"}}). They're now real snippets that don't repeat the typed{{and absorb an auto-closed}}. CodeMirror has vitest coverage (pnpm exec vitest runinpackages/codemirror).{{/section}}removed from monaco/codemirror samples; READMEs and the vscode CHANGELOG (Unreleased) updated; snippet default model isgemini-flash-latest.Why
With #640-#645, runtimes only honor markers carrying a random per-render nonce, so a literal
<<<dotprompt:role:system>>>in a template renders as text in a user message. The tooling was teaching a form that now silently does nothing (raised in review of #640).Breaking changes (tooling)
dotprompt_markerandmarker_contentare gone; external queries referencing them will fail to compile.DotpromptTokenTypes.MARKERand theDOTPROMPT_MARKERcolor key are removed.keyword.markertoken is no longer emitted.Not in this PR
dist/(already stale vssrcon main; rebuilt at release).{{#role}}:examples/*.prompt, Dart docs,rs/promptlyLSP hover text, the streamlit-monaco demo,docs/design/promptly.md, the tree-sitter "ROLE BLOCK" corpus test, monaco/codemirror fold/indent rules.