Skip to content

Commit 9a56cc4

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 9a56cc4

File tree

20 files changed

+1049
-1423
lines changed

20 files changed

+1049
-1423
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: 5 additions & 3 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
@@ -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/monaco/README.md

Lines changed: 6 additions & 6 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.
@@ -182,11 +182,11 @@ Token types available for theming:
182182
| `delimiter.frontmatter` | `---` delimiters |
183183
| `delimiter.handlebars` | `{{` and `}}` |
184184
| `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 |
185+
| keyword.handlebars | if, each, with, etc. |
186+
| keyword.dotprompt | role, json, history, etc. |
187+
| keyword.yaml | YAML frontmatter keys |
188+
| variable | Template variables |
189+
190190
| `variable.partial` | Partial names |
191191
| `variable.special` | @index, @first, etc. |
192192
| `comment.block` | `{{! comment }}` |

packages/monaco/src/language.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ export const monarchLanguage: monaco.languages.IMonarchLanguage = {
7979
// Frontmatter delimiter
8080
[/^---\s*$/, { token: 'delimiter.frontmatter', next: '@frontmatter' }],
8181

82-
// Dotprompt markers <<<dotprompt:...>>>
83-
[/<<<dotprompt:[^>]+>>>/, 'keyword.marker'],
84-
8582
// Include template tokens
8683
{ include: '@template' },
8784
],

packages/treesitter/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ A [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) grammar for Dotpromp
66

77
- Parses YAML frontmatter
88
- Parses Handlebars template expressions
9-
- Parses Dotprompt-specific syntax (markers, helpers)
109
- Supports license header comments
1110

1211
## Installation
@@ -147,19 +146,19 @@ document
147146
│ ├── block_expression
148147
│ ├── else_expression
149148
│ └── close_block
150-
├── handlebars_comment ({{! ... }})
151-
└── dotprompt_marker (<<<dotprompt:...>>>)
149+
└── handlebars_comment ({{! ... }})
152150
```
153151

154152
## Queries
155153

156154
### Highlights (`queries/highlights.scm`)
157155

158156
Provides syntax highlighting for:
157+
159158
- YAML frontmatter
160159
- Handlebars expressions and blocks
161160
- Dotprompt-specific helpers
162-
- Comments and markers
161+
- Comments
163162

164163
## License
165164

0 commit comments

Comments
 (0)