From 42434d7c150aa3ebb2879f1f19fddeada1eaa872 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 7 Jan 2026 11:46:21 +0100 Subject: [PATCH] Can't preview custom agents' markdown files (#286331) --- .../markdown-language-features/package.json | 32 +++++++++---------- .../src/util/file.ts | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/extensions/markdown-language-features/package.json b/extensions/markdown-language-features/package.json index 3abd4436b3d..1df0b43d840 100644 --- a/extensions/markdown-language-features/package.json +++ b/extensions/markdown-language-features/package.json @@ -19,7 +19,7 @@ "onLanguage:markdown", "onLanguage:prompt", "onLanguage:instructions", - "onLanguage:chatmode", + "onLanguage:chatagent", "onCommand:markdown.api.render", "onCommand:markdown.api.reloadPlugins", "onWebviewPanel:markdown.preview" @@ -181,13 +181,13 @@ "command": "markdown.editor.insertLinkFromWorkspace", "title": "%markdown.editor.insertLinkFromWorkspace%", "category": "Markdown", - "enablement": "editorLangId =~ /^(markdown|prompt|instructions|chatmode)$/ && !activeEditorIsReadonly" + "enablement": "editorLangId =~ /^(markdown|prompt|instructions|chatagent)$/ && !activeEditorIsReadonly" }, { "command": "markdown.editor.insertImageFromWorkspace", "title": "%markdown.editor.insertImageFromWorkspace%", "category": "Markdown", - "enablement": "editorLangId =~ /^(markdown|prompt|instructions|chatmode)$/ && !activeEditorIsReadonly" + "enablement": "editorLangId =~ /^(markdown|prompt|instructions|chatagent)$/ && !activeEditorIsReadonly" } ], "menus": { @@ -204,7 +204,7 @@ "editor/title": [ { "command": "markdown.showPreviewToSide", - "when": "editorLangId =~ /^(markdown|prompt|instructions|chatmode)$/ && !notebookEditorFocused && !hasCustomMarkdownPreview", + "when": "editorLangId =~ /^(markdown|prompt|instructions|chatagent)$/ && !notebookEditorFocused && !hasCustomMarkdownPreview", "alt": "markdown.showPreview", "group": "navigation" }, @@ -232,24 +232,24 @@ "explorer/context": [ { "command": "markdown.showPreview", - "when": "resourceLangId =~ /^(markdown|prompt|instructions|chatmode)$/ && !hasCustomMarkdownPreview", + "when": "resourceLangId =~ /^(markdown|prompt|instructions|chatagent)$/ && !hasCustomMarkdownPreview", "group": "navigation" }, { "command": "markdown.findAllFileReferences", - "when": "resourceLangId =~ /^(markdown|prompt|instructions|chatmode)$/", + "when": "resourceLangId =~ /^(markdown|prompt|instructions|chatagent)$/", "group": "4_search" } ], "editor/title/context": [ { "command": "markdown.showPreview", - "when": "resourceLangId =~ /^(markdown|prompt|instructions|chatmode)$/ && !hasCustomMarkdownPreview", + "when": "resourceLangId =~ /^(markdown|prompt|instructions|chatagent)$/ && !hasCustomMarkdownPreview", "group": "1_open" }, { "command": "markdown.findAllFileReferences", - "when": "resourceLangId =~ /^(markdown|prompt|instructions|chatmode)$/" + "when": "resourceLangId =~ /^(markdown|prompt|instructions|chatagent)$/" } ], "commandPalette": [ @@ -263,17 +263,17 @@ }, { "command": "markdown.showPreview", - "when": "editorLangId =~ /^(markdown|prompt|instructions|chatmode)$/ && !notebookEditorFocused", + "when": "editorLangId =~ /^(markdown|prompt|instructions|chatagent)$/ && !notebookEditorFocused", "group": "navigation" }, { "command": "markdown.showPreviewToSide", - "when": "editorLangId =~ /^(markdown|prompt|instructions|chatmode)$/ && !notebookEditorFocused", + "when": "editorLangId =~ /^(markdown|prompt|instructions|chatagent)$/ && !notebookEditorFocused", "group": "navigation" }, { "command": "markdown.showLockedPreviewToSide", - "when": "editorLangId =~ /^(markdown|prompt|instructions|chatmode)$/ && !notebookEditorFocused", + "when": "editorLangId =~ /^(markdown|prompt|instructions|chatagent)$/ && !notebookEditorFocused", "group": "navigation" }, { @@ -283,7 +283,7 @@ }, { "command": "markdown.showPreviewSecuritySelector", - "when": "editorLangId =~ /^(markdown|prompt|instructions|chatmode)$/ && !notebookEditorFocused" + "when": "editorLangId =~ /^(markdown|prompt|instructions|chatagent)$/ && !notebookEditorFocused" }, { "command": "markdown.showPreviewSecuritySelector", @@ -295,7 +295,7 @@ }, { "command": "markdown.preview.refresh", - "when": "editorLangId =~ /^(markdown|prompt|instructions|chatmode)$/ && !notebookEditorFocused" + "when": "editorLangId =~ /^(markdown|prompt|instructions|chatagent)$/ && !notebookEditorFocused" }, { "command": "markdown.preview.refresh", @@ -303,7 +303,7 @@ }, { "command": "markdown.findAllFileReferences", - "when": "editorLangId =~ /^(markdown|prompt|instructions|chatmode)$/" + "when": "editorLangId =~ /^(markdown|prompt|instructions|chatagent)$/" } ] }, @@ -312,13 +312,13 @@ "command": "markdown.showPreview", "key": "shift+ctrl+v", "mac": "shift+cmd+v", - "when": "editorLangId =~ /^(markdown|prompt|instructions|chatmode)$/ && !notebookEditorFocused" + "when": "editorLangId =~ /^(markdown|prompt|instructions|chatagent)$/ && !notebookEditorFocused" }, { "command": "markdown.showPreviewToSide", "key": "ctrl+k v", "mac": "cmd+k v", - "when": "editorLangId =~ /^(markdown|prompt|instructions|chatmode)$/ && !notebookEditorFocused" + "when": "editorLangId =~ /^(markdown|prompt|instructions|chatagent)$/ && !notebookEditorFocused" } ], "configuration": { diff --git a/extensions/markdown-language-features/src/util/file.ts b/extensions/markdown-language-features/src/util/file.ts index f99135b0200..aa793045278 100644 --- a/extensions/markdown-language-features/src/util/file.ts +++ b/extensions/markdown-language-features/src/util/file.ts @@ -19,7 +19,7 @@ export const markdownFileExtensions = Object.freeze([ 'workbook', ]); -export const markdownLanguageIds = ['markdown', 'prompt', 'instructions', 'chatmode']; +export const markdownLanguageIds = ['markdown', 'prompt', 'instructions', 'chatagent']; export function isMarkdownFile(document: vscode.TextDocument) { return markdownLanguageIds.indexOf(document.languageId) !== -1;