feat: enable AI Copilot Action in the editor settings

This commit is contained in:
purocean
2024-08-05 11:27:56 +08:00
parent 298671397e
commit f49fcfdd59
6 changed files with 14 additions and 1 deletions
+8
View File
@@ -267,6 +267,14 @@ const schema: SettingSchema = ({
group: 'editor',
required: true,
},
'editor.enable-ai-copilot-action': {
defaultValue: true,
title: 'T_setting-panel.schema.editor.enable-ai-copilot-action',
type: 'boolean',
format: 'checkbox',
group: 'editor',
required: true,
},
'render.md-html': {
defaultValue: true,
title: 'T_setting-panel.schema.render.md-html',
+2 -1
View File
@@ -14,7 +14,8 @@ export default {
provideCodeActions (): languages.CodeActionList {
const actionTitle = ctx.i18n.t('edit-or-generate-text-using-ai')
if (!getInitialized() || checkExtensionLoaded()) {
const enabled = ctx.setting.getSetting('editor.enable-ai-copilot-action')
if (!getInitialized() || checkExtensionLoaded() || !enabled) {
return { dispose: () => 0, actions: [] }
}
+1
View File
@@ -334,6 +334,7 @@ export interface BuildInSettings {
'editor.minimap': boolean,
'editor.line-numbers': 'on' | 'off' | 'relative' | 'interval',
'editor.enable-preview': boolean,
'editor.enable-ai-copilot-action': boolean,
'editor.font-family': string,
'editor.complete-emoji': boolean,
'editor.todo-with-time': boolean,
+1
View File
@@ -401,6 +401,7 @@ const data = {
'suggest-on-trigger-characters': 'Suggest on trigger characters - You can also use Ctrl+Space (depending on the shortcuts) to trigger',
'sticky-scroll-enabled': 'Enable Sticky Scroll - When the editor scrolls, the document title is fixed',
'quick-suggestions': 'Quick Suggestions - Suggest as you type',
'enable-ai-copilot-action': 'Enable the AI Copilot Action - Show the AI Copilot Action lightbulb when available',
},
'render': {
'md-html': 'Enable HTML',
+1
View File
@@ -392,6 +392,7 @@ const data: BaseLanguage = {
'suggest-on-trigger-characters': '自动提示 - 输入提示符时显示提示。如果禁用,仍可使用 Ctrl+Space (取决于快捷键配置) 触发',
'sticky-scroll-enabled': '启用粘性滚动 - 当编辑器滚动时,固定显示文档标题等',
'quick-suggestions': '快速提示 - 在输入文本时显示提示',
'enable-ai-copilot-action': '启用 AI Copilot 操作 - 当可用时显示 AI Copilot 操作灯泡',
},
'render': {
'md-html': '启用 HTML',
+1
View File
@@ -392,6 +392,7 @@ const data: BaseLanguage = {
'suggest-on-trigger-characters': '自動提示 - 輸入提示符號時顯示提示。若停用,仍可使用 Ctrl+Space (依據快速鍵設定) 觸發',
'sticky-scroll-enabled': '啟用黏性捲動 - 當編輯器捲動時,固定顯示文件標題等',
'quick-suggestions': '快速提示 - 在輸入文字時顯示提示',
'enable-ai-copilot-action': '啟用 AI Copilot 操作 - 當可用時顯示 AI Copilot 操作燈泡',
},
'render': {
'md-html': '啟用 HTML',