From 1a70853fb82d6bb2be4bbcb2e5d0b5cd8882e3ab Mon Sep 17 00:00:00 2001 From: Rankin Zheng Date: Mon, 28 Aug 2023 15:27:00 +0800 Subject: [PATCH] Add settings link to DevChat - Added a case for "#settings" in MessageMarkdown component to handle settings command. - Included "#settings" in the list of custom anchors. - Replaced the settings button in ChatStore with a link to settings. --- src/views/components/MessageMarkdown/index.tsx | 6 +++++- src/views/stores/ChatStore.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/components/MessageMarkdown/index.tsx b/src/views/components/MessageMarkdown/index.tsx index 141ed9d..c55ae9f 100644 --- a/src/views/components/MessageMarkdown/index.tsx +++ b/src/views/components/MessageMarkdown/index.tsx @@ -117,6 +117,9 @@ Generate a professionally written and formatted release note in markdown with th }), ]); break; + case "#settings": + messageUtil.sendMessage({ command: 'doCommand', content: ['workbench.action.openSettings', 'DevChat'] }); + break; } chat.goScrollBottom(); }; @@ -189,7 +192,8 @@ Generate a professionally written and formatted release note in markdown with th "#commit_message", "#release_note", "#ask_code", - "#extension"].filter((item) => item === href); + "#extension", + "#settings"].filter((item) => item === href); return customAnchors.length > 0 ? { handleExplain(href); diff --git a/src/views/stores/ChatStore.ts b/src/views/stores/ChatStore.ts index b9d79e0..16d2864 100644 --- a/src/views/stores/ChatStore.ts +++ b/src/views/stores/ChatStore.ts @@ -98,7 +98,7 @@ To get started, here are some of the things that I can do for you: ${self.features['ask-code'] ? '[/ask-code: ask me questions about your codebase](#ask_code)' : ''} -`; +You can configure DevChat from [Settings](#settings).`; self.messages.push( Message.create({