diff --git a/extensions/vscode/media/prompt.tmLanguage.json b/extensions/vscode/media/prompt.tmLanguage.json new file mode 100644 index 000000000..c1022d882 --- /dev/null +++ b/extensions/vscode/media/prompt.tmLanguage.json @@ -0,0 +1,64 @@ +{ + "name": "Prompt", + "scopeName": "source.prompt", + "patterns": [ + { + "include": "#at-references" + }, + { + "include": "#strings" + }, + { + "include": "#comments" + } + ], + "repository": { + "at-references": { + "patterns": [ + { + "name": "entity.name.type.prompt", + "match": "@\\S+" + } + ] + }, + "strings": { + "patterns": [ + { + "name": "string.quoted.double.prompt", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "name": "constant.character.escape.prompt", + "match": "\\\\." + } + ] + }, + { + "name": "string.quoted.single.prompt", + "begin": "'", + "end": "'", + "patterns": [ + { + "name": "constant.character.escape.prompt", + "match": "\\\\." + } + ] + } + ] + }, + "comments": { + "patterns": [ + { + "name": "comment.line.double-slash.prompt", + "match": "//.*$" + }, + { + "name": "comment.block.prompt", + "begin": "/\\*", + "end": "\\*/" + } + ] + } + } +} diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index aeb32f078..52029445b 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -76,6 +76,13 @@ "configuration": "./prompt-file-language-configuration.json" } ], + "grammars": [ + { + "language": "promptLanguage", + "scopeName": "source.prompt", + "path": "./media/prompt.tmLanguage.json" + } + ], "configuration": { "title": "Continue", "properties": {