Skip to content

Commit 61c5006

Browse files
committed
fix: remove internal dotprompt markers from user-facing tools
Removes support for internal <<<dotprompt:...>>> markers from all editor extensions and user-facing tools. These markers were intended for internal processing and should not be exposed to end-users in templates, READMEs, or snippets. This update affects multiple packages: - docs: update design documentation to remove marker references - packages/codemirror: remove marker highlighting and stream parser rules - packages/emacs: remove marker font-lock patterns and documentation - packages/jetbrains: remove marker lexer rules and documentation - packages/monaco: remove marker syntax highlighting and theme tokens - packages/promptly: remove marker references from design docs - packages/treesitter: remove marker from grammar, queries, and corpus - packages/vim: remove marker syntax rules and highlighting - packages/vscode: remove marker snippets, grammar rules, and README references
1 parent 0911cf9 commit 61c5006

File tree

24 files changed

+1080
-1462
lines changed

24 files changed

+1080
-1462
lines changed

docs/design/promptly.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6587,7 +6587,6 @@ packages/chrome/
65876587
| Handlebars braces | Orange | `{{`, `}}` |
65886588
| Handlebars helper | Purple | `#if`, `#each`, `#role` |
65896589
| Variable | Cyan | `{{ name }}` |
6590-
| Dotprompt marker | Magenta | `<<<dotprompt:role>>>` |
65916590
| Comment | Gray italic | `{{! comment }}` |
65926591

65936592
| Component | Status | Location |

packages/codemirror/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ CodeMirror 6 language support for Dotprompt (`.prompt`) files.
44

55
## Features
66

7-
- **Syntax Highlighting**: YAML frontmatter, Handlebars templates, Dotprompt
8-
markers
7+
- **Syntax Highlighting**: YAML frontmatter, Handlebars templates
98
- **Autocompletion**: Helpers, frontmatter fields, model names
109
- **Theming**: Dark and light theme support
1110

packages/codemirror/src/language.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,6 @@ export const dotpromptStreamParser = {
155155
return 'comment';
156156
}
157157

158-
// Dotprompt markers
159-
if (stream.match(/<<<dotprompt:[^>]+>>>/)) {
160-
return 'keyword';
161-
}
162-
163158
// Handlebars block start {{#helper
164159
if (stream.match(/\{\{#/)) {
165160
state.context = 'handlebars';

packages/emacs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Provides a major mode for editing Dotprompt (`.prompt`) files with syntax highli
44

55
## Features
66

7-
- **Syntax Highlighting**: Handlebars helpers, partials, Dotprompt markers
7+
- **Syntax Highlighting**: Handlebars helpers, partials
88
- **LSP Integration**: Diagnostics, formatting, hover via eglot or lsp-mode
99
- **Format Buffer**: `C-c C-f` or `M-x dotprompt-format-buffer`
1010
- **Format on Save**: Optional automatic formatting

packages/emacs/dotprompt-mode.el

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
;;; Commentary:
2424

2525
;; Major mode for editing Dotprompt files (.prompt).
26-
;; Provides syntax highlighting for markers, helpers, and partials.
26+
;; Provides syntax highlighting for helpers and partials.
2727
;; Includes LSP integration via eglot or lsp-mode for diagnostics,
2828
;; formatting, and hover documentation when `promptly` is installed.
2929
;;
@@ -69,9 +69,6 @@
6969
;; YAML numeric values
7070
'(":\\s-+\\([0-9]+\\.?[0-9]*\\)$" 1 font-lock-constant-face)
7171

72-
;; Dotprompt markers <<<dotprompt:role:system>>> etc.
73-
'("<<<dotprompt:[^>]+>>>" . font-lock-preprocessor-face)
74-
7572
;; Handlebars block comments {{!-- ... --}}
7673
'("{{!--\\(.\\|\n\\)*?--}}" . font-lock-comment-face)
7774

packages/jetbrains/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Language support for Dotprompt (`.prompt`) files in JetBrains IDEs (IntelliJ IDE
44

55
## Features
66

7-
- **Syntax Highlighting**: YAML frontmatter, Handlebars templates, Dotprompt markers
7+
- **Syntax Highlighting**: YAML frontmatter, Handlebars templates
88
- **LSP Integration**: Real-time diagnostics, formatting, and hover documentation (via LSP4IJ)
99
- **Live Templates**: Type `role`, `if`, `each`, `json` + Tab for quick insertions
1010
- **Code Comments**: Block comment support using `{{! ... }}`
@@ -30,6 +30,7 @@ Language support for Dotprompt (`.prompt`) files in JetBrains IDEs (IntelliJ IDE
3030
1. **Prerequisites**: Ensure you have Gradle and JDK 17+ installed
3131

3232
2. **Build the plugin**:
33+
3334
```bash
3435
cd packages/jetbrains
3536
gradle buildPlugin
@@ -49,8 +50,8 @@ bazel build //packages/jetbrains:dotprompt-intellij
4950

5051
This produces `bazel-bin/packages/jetbrains/dotprompt-intellij.jar`.
5152

52-
> **Note**: For full plugin packaging (with plugin.xml, icons, LSP4IJ integration),
53-
> use the Gradle build. The Bazel target is useful for incremental compilation
53+
> **Note**: For full plugin packaging (with plugin.xml, icons, LSP4IJ integration),
54+
> use the Gradle build. The Bazel target is useful for incremental compilation
5455
> during development and IDE integration.
5556
5657
### Install promptly for LSP Features
@@ -80,10 +81,10 @@ Type these abbreviations and press Tab to expand:
8081

8182
| Abbreviation | Expands To |
8283
|--------------|------------|
83-
| `role` | Role block with customizable role name |
84-
| `system` | System role block |
85-
| `user` | User role block |
86-
| `model` | Model role block |
84+
| `role` | Role marker with customizable role name |
85+
| `system` | System role marker |
86+
| `user` | User role marker |
87+
| `model` | Model role marker |
8788
| `if` | Handlebars if block |
8889
| `ifelse` | Handlebars if-else block |
8990
| `unless` | Handlebars unless block |
@@ -92,7 +93,7 @@ Type these abbreviations and press Tab to expand:
9293
| `json` | JSON serialization helper |
9394
| `media` | Media embedding helper |
9495
| `history` | History insertion |
95-
| `section` | Named section block |
96+
| `section` | Named section marker |
9697
| `partial` | Partial template inclusion |
9798
| `comment` | Handlebars comment |
9899
| `prompt` | Complete prompt template |
@@ -121,6 +122,7 @@ Go to **Settings/Preferences** → **Languages & Frameworks** → **Dotprompt**:
121122
### Auto-Detection
122123

123124
The plugin automatically finds `promptly` in:
125+
124126
1. User-configured path (Settings)
125127
2. System PATH
126128
3. `~/.cargo/bin/promptly`

packages/jetbrains/src/main/kotlin/com/google/dotprompt/DotpromptLexer.kt

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import com.intellij.psi.tree.IElementType
2525
* This lexer recognizes:
2626
* - YAML frontmatter delimiters (---)
2727
* - Handlebars expressions ({{ ... }})
28-
* - Dotprompt markers (<<<dotprompt:...>>>)
2928
* - Comments ({{! ... }})
3029
*/
3130
class DotpromptLexer : LexerBase() {
@@ -85,14 +84,6 @@ class DotpromptLexer : LexerBase() {
8584
return
8685
}
8786

88-
// Check for Dotprompt marker
89-
if (lookingAt("<<<dotprompt:")) {
90-
val end = findEndOfMarker()
91-
tokenEnd = end
92-
tokenType = DotpromptTokenTypes.MARKER
93-
return
94-
}
95-
9687
// Check for Handlebars comment
9788
if (lookingAt("{{!")) {
9889
val end = findEndOfHandlebars()
@@ -141,17 +132,6 @@ class DotpromptLexer : LexerBase() {
141132
return true
142133
}
143134

144-
private fun findEndOfMarker(): Int {
145-
var pos = tokenStart
146-
while (pos < bufferEnd - 2) {
147-
if (buffer[pos] == '>' && buffer[pos + 1] == '>' && buffer[pos + 2] == '>') {
148-
return pos + 3
149-
}
150-
pos++
151-
}
152-
return bufferEnd
153-
}
154-
155135
private fun findEndOfHandlebars(): Int {
156136
var pos = tokenStart
157137
while (pos < bufferEnd - 1) {
@@ -175,8 +155,7 @@ class DotpromptLexer : LexerBase() {
175155
var pos = tokenStart + 1
176156
while (pos < bufferEnd) {
177157
if (lookingAtPos(pos, "---") ||
178-
lookingAtPos(pos, "{{") ||
179-
lookingAtPos(pos, "<<<dotprompt:")) {
158+
lookingAtPos(pos, "{{")) {
180159
return pos
181160
}
182161
if (buffer[pos] == '\n' && state == STATE_FRONTMATTER) {

packages/jetbrains/src/main/resources/liveTemplates/Dotprompt.xml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,27 @@
1717
SPDX-License-Identifier: Apache-2.0
1818
-->
1919
<templateSet group="Dotprompt">
20-
<!-- Role blocks -->
21-
<template name="role" value="{{#role &quot;$ROLE$&quot;}}&#10;$CONTENT$&#10;{{/role}}" description="Handlebars role block" toReformat="false" toShortenFQNames="true">
20+
<!-- Role markers -->
21+
<template name="role" value="{{role &quot;$ROLE$&quot;}}&#10;$0" description="Handlebars role marker" toReformat="false" toShortenFQNames="true">
2222
<variable name="ROLE" expression="" defaultValue="&quot;user&quot;" alwaysStopAt="true"/>
23-
<variable name="CONTENT" expression="" defaultValue="" alwaysStopAt="true"/>
2423
<context>
2524
<option name="OTHER" value="true"/>
2625
</context>
2726
</template>
2827

29-
<template name="system" value="{{#role &quot;system&quot;}}&#10;$CONTENT$&#10;{{/role}}" description="System role block" toReformat="false" toShortenFQNames="true">
30-
<variable name="CONTENT" expression="" defaultValue="" alwaysStopAt="true"/>
28+
<template name="system" value="{{role &quot;system&quot;}}&#10;$0" description="System role marker" toReformat="false" toShortenFQNames="true">
3129
<context>
3230
<option name="OTHER" value="true"/>
3331
</context>
3432
</template>
3533

36-
<template name="user" value="{{#role &quot;user&quot;}}&#10;$CONTENT$&#10;{{/role}}" description="User role block" toReformat="false" toShortenFQNames="true">
37-
<variable name="CONTENT" expression="" defaultValue="" alwaysStopAt="true"/>
34+
<template name="user" value="{{role &quot;user&quot;}}&#10;$0" description="User role marker" toReformat="false" toShortenFQNames="true">
3835
<context>
3936
<option name="OTHER" value="true"/>
4037
</context>
4138
</template>
4239

43-
<template name="model" value="{{#role &quot;model&quot;}}&#10;$CONTENT$&#10;{{/role}}" description="Model role block" toReformat="false" toShortenFQNames="true">
44-
<variable name="CONTENT" expression="" defaultValue="" alwaysStopAt="true"/>
40+
<template name="model" value="{{role &quot;model&quot;}}&#10;$0" description="Model role marker" toReformat="false" toShortenFQNames="true">
4541
<context>
4642
<option name="OTHER" value="true"/>
4743
</context>
@@ -129,9 +125,8 @@
129125
</context>
130126
</template>
131127

132-
<template name="section" value="{{#section &quot;$NAME$&quot;}}&#10;$CONTENT$&#10;{{/section}}" description="Named section block" toReformat="false" toShortenFQNames="true">
128+
<template name="section" value="{{section &quot;$NAME$&quot;}}&#10;$0" description="Named section marker" toReformat="false" toShortenFQNames="true">
133129
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true"/>
134-
<variable name="CONTENT" expression="" defaultValue="" alwaysStopAt="true"/>
135130
<context>
136131
<option name="OTHER" value="true"/>
137132
</context>
@@ -154,7 +149,7 @@
154149
</template>
155150

156151
<!-- Full template -->
157-
<template name="prompt" value="---&#10;model: $MODEL$&#10;config:&#10; temperature: $TEMPERATURE$&#10;input:&#10; schema:&#10; $VARIABLE$: string&#10;---&#10;&#10;{{#role &quot;system&quot;}}&#10;$SYSTEM_PROMPT$&#10;{{/role}}&#10;&#10;{{#role &quot;user&quot;}}&#10;$USER_PROMPT$&#10;{{/role}}" description="Complete prompt template" toReformat="false" toShortenFQNames="true">
152+
<template name="prompt" value="---&#10;model: $MODEL$&#10;config:&#10; temperature: $TEMPERATURE$&#10;input:&#10; schema:&#10; $VARIABLE$: string&#10;---&#10;&#10;{{role &quot;system&quot;}}&#10;$SYSTEM_PROMPT$&#10;&#10;{{role &quot;user&quot;}}&#10;$USER_PROMPT$" description="Complete prompt template" toReformat="false" toShortenFQNames="true">
158153
<variable name="MODEL" expression="" defaultValue="&quot;gemini-2.5-flash&quot;" alwaysStopAt="true"/>
159154
<variable name="TEMPERATURE" expression="" defaultValue="&quot;0.7&quot;" alwaysStopAt="true"/>
160155
<variable name="VARIABLE" expression="" defaultValue="&quot;name&quot;" alwaysStopAt="true"/>

packages/monaco/README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Monaco Editor language support for Dotprompt (`.prompt`) files.
44

55
## Features
66

7-
- **Syntax Highlighting**: YAML frontmatter, Handlebars templates, Dotprompt markers
7+
- **Syntax Highlighting**: YAML frontmatter, Handlebars templates
88
- **Autocompletion**: Helpers, frontmatter fields, model names, role snippets
99
- **Hover Documentation**: Helper and frontmatter field documentation
1010
- **Bracket Matching**: Auto-closing for `{{ }}`, `{{# }}`, etc.
@@ -38,13 +38,11 @@ config:
3838
temperature: 0.7
3939
---
4040
41-
{{#role "system"}}
41+
{{role "system"}}
4242
You are a helpful assistant.
43-
{{/role}}
4443
45-
{{#role "user"}}
46-
Hello, {{ name }}!
47-
{{/role}}`,
44+
{{role "user"}}
45+
Hello, {{ name }}!`,
4846
language: 'dotprompt',
4947
theme: 'vs-dark',
5048
});
@@ -167,8 +165,8 @@ The completion provider offers:
167165

168166
| Context | Completions |
169167
|---------|-------------|
170-
| `{{` | Handlebars helpers, Dotprompt helpers |
171-
| `{{#` | Block helpers (if, each, role, section) |
168+
| `{{` | Handlebars helpers, Dotprompt helpers (role, section, json, etc.) |
169+
| `{{#` | Block helpers (if, each, with, ifEquals) |
172170
| `{{>` | Partial template reference |
173171
| `model:` | Model names (Gemini, GPT, Claude) |
174172
| Frontmatter | Field names (model, config, input, output) |
@@ -182,11 +180,11 @@ Token types available for theming:
182180
| `delimiter.frontmatter` | `---` delimiters |
183181
| `delimiter.handlebars` | `{{` and `}}` |
184182
| `delimiter.handlebars.block` | `{{#` and `{{/` |
185-
| `keyword.handlebars` | if, each, with, etc. |
186-
| `keyword.dotprompt` | role, json, history, etc. |
187-
| `keyword.yaml` | YAML frontmatter keys |
188-
| `keyword.marker` | `<<<dotprompt:...>>>` |
189-
| `variable` | Template variables |
183+
| keyword.handlebars | if, each, with, etc. |
184+
| keyword.dotprompt | role, json, history, etc. |
185+
| keyword.yaml | YAML frontmatter keys |
186+
| variable | Template variables |
187+
190188
| `variable.partial` | Partial names |
191189
| `variable.special` | @index, @first, etc. |
192190
| `comment.block` | `{{! comment }}` |

packages/monaco/src/completions.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const DOTPROMPT_HELPERS = [
8282
{
8383
label: 'role',
8484
kind: 1,
85-
insertText: '{{#role "${1|system,user,model|}"}}}\n\t$0\n{{/role}}',
85+
insertText: '{{role "${1|system,user,model|}"}}',
8686
insertTextRules: 4,
8787
documentation:
8888
'Defines a message with a specific role (system, user, or model).',
@@ -103,7 +103,7 @@ const DOTPROMPT_HELPERS = [
103103
{
104104
label: 'section',
105105
kind: 1,
106-
insertText: '{{#section "${1:name}"}}\n\t$0\n{{/section}}',
106+
insertText: '{{section "${1:name}"}}',
107107
insertTextRules: 4,
108108
documentation: 'Defines a named section that can be referenced elsewhere.',
109109
},
@@ -138,24 +138,24 @@ const ROLE_SNIPPETS = [
138138
{
139139
label: 'system',
140140
kind: 15, // Snippet
141-
insertText: '{{#role "system"}}\n\t$0\n{{/role}}',
141+
insertText: '{{role "system"}}\n$0',
142142
insertTextRules: 4,
143-
documentation: "System role block - sets the AI's behavior and context.",
143+
documentation: "System role marker - sets the AI's behavior and context.",
144144
},
145145
{
146146
label: 'user',
147147
kind: 15,
148-
insertText: '{{#role "user"}}\n\t$0\n{{/role}}',
148+
insertText: '{{role "user"}}\n$0',
149149
insertTextRules: 4,
150-
documentation: 'User role block - represents user input.',
150+
documentation: 'User role marker - represents user input.',
151151
},
152152
{
153153
label: 'model',
154154
kind: 15,
155-
insertText: '{{#role "model"}}\n\t$0\n{{/role}}',
155+
insertText: '{{role "model"}}\n$0',
156156
insertTextRules: 4,
157157
documentation:
158-
'Model role block - represents AI responses (for few-shot examples).',
158+
'Model role marker - represents AI responses (for few-shot examples).',
159159
},
160160
];
161161

@@ -347,7 +347,7 @@ export function createCompletionProvider(
347347
['if', 'unless', 'each', 'with'].includes(h.label)
348348
),
349349
...DOTPROMPT_HELPERS.filter((h) =>
350-
['role', 'section', 'ifEquals', 'unlessEquals'].includes(h.label)
350+
['ifEquals', 'unlessEquals'].includes(h.label)
351351
),
352352
].map((item) => ({
353353
...item,

0 commit comments

Comments
 (0)