feat(query-editor): 增强 SQL 编辑器 AI 内联补全与独立模型配置

- 新增独立内联补全模型配置与服务端透传
- 优化 SQL 编辑器 Alt+\\ 触发、ghost 延续与对象位补全
- 引入基于已存查询和执行日志的 SQL 记忆补全
- 补充前后端本地化、快捷键与补全回归测试
This commit is contained in:
Syngnat
2026-07-03 20:44:33 +08:00
parent 5eafd2aa3c
commit 29ee21e9d7
32 changed files with 4399 additions and 209 deletions

View File

@@ -1643,11 +1643,15 @@
"ai_settings.form.model_list_placeholder": "Modell-IDs konfigurieren; leer lassen, um sie vom Server abzurufen",
"ai_settings.form.model_list_placeholder.codebuddy": "Optional: Häufige Modelle vorab eintragen; leer lassen, damit CodeBuddy CLI oder der Dienst automatisch wählt",
"ai_settings.form.model_list_placeholder.cursor": "Optional: Häufige Cursor-Modell-IDs vorab eintragen; leer lassen, damit automatisch das Standardmodell von Cursor gewählt wird",
"ai_settings.form.inline_completion_model": "Autovervollständigungsmodell",
"ai_settings.form.inline_completion_model_hint": "Wähle ein kleineres, schnelleres Modell für SQL-Editor-Geistervorschläge. Leer lassen, um dem Chatmodell zu folgen.",
"ai_settings.form.inline_completion_model_placeholder": "Chatmodell verwenden",
"ai_settings.form.provider_name": "Anbietername",
"ai_settings.form.provider_name_placeholder": "Beispiel: eigener OpenAI-kompatibler Endpunkt / privates Modell",
"ai_settings.form.provider_name_required": "Bitte einen Namen eingeben",
"ai_settings.form.section.auth_connection": "Authentifizierung und Verbindung",
"ai_settings.form.section.basic": "Basisinformationen",
"ai_settings.form.section.inline_completion": "SQL-Autovervollständigung",
"ai_settings.form.section.service_type": "Diensttyp",
"ai_settings.mcp_http.error.control_unsupported_runtime": "Die aktuelle Laufzeit unterstützt keine Steuerung des MCP HTTP-Dienstes",
"ai_settings.mcp_http.error.start_unsupported_version": "Diese Version unterstützt das Starten des MCP HTTP-Dienstes nicht",
@@ -2619,6 +2623,8 @@
"app.shortcuts.action.duplicateCurrentLine.label": "Aktuelle Zeile darunter duplizieren",
"app.shortcuts.action.formatSql.description": "SQL im aktuellen Abfrageeditor formatieren",
"app.shortcuts.action.formatSql.label": "SQL formatieren",
"app.shortcuts.action.triggerSqlAiCompletion.description": "AI-Inline-Vervollständigung im aktuellen SQL-Editor manuell anfordern",
"app.shortcuts.action.triggerSqlAiCompletion.label": "SQL-AI-Vervollständigung auslösen",
"app.shortcuts.action.selectCurrentStatement.description": "Zeile an der Cursorposition im Abfrageeditor auswählen und in die Zwischenablage kopieren",
"app.shortcuts.action.selectCurrentStatement.label": "Aktuelle Zeile auswählen und kopieren",
"app.shortcuts.action.sendAIChatMessage.description": "Aktuelle Nachricht im AI-Eingabefeld senden; Shift+Enter fügt immer einen Zeilenumbruch ein",

View File

@@ -1643,11 +1643,15 @@
"ai_settings.form.model_list_placeholder": "Configure model IDs; leave blank to fetch them from the server",
"ai_settings.form.model_list_placeholder.codebuddy": "Optional: prefill common models; leave blank to let CodeBuddy CLI or the service choose automatically",
"ai_settings.form.model_list_placeholder.cursor": "Optional: prefill common Cursor model IDs; leave blank to use Cursor's default model automatically",
"ai_settings.form.inline_completion_model": "Auto-completion model",
"ai_settings.form.inline_completion_model_hint": "Choose a smaller, faster model for SQL editor ghost completions. Leave blank to follow the chat model.",
"ai_settings.form.inline_completion_model_placeholder": "Follow chat model",
"ai_settings.form.provider_name": "Provider name",
"ai_settings.form.provider_name_placeholder": "Example: My OpenAI-compatible endpoint / private model",
"ai_settings.form.provider_name_required": "Enter a name",
"ai_settings.form.section.auth_connection": "Authentication & connection",
"ai_settings.form.section.basic": "Basic information",
"ai_settings.form.section.inline_completion": "SQL auto-completion",
"ai_settings.form.section.service_type": "Service type",
"ai_settings.mcp_http.error.control_unsupported_runtime": "The current runtime does not support MCP HTTP server control",
"ai_settings.mcp_http.error.start_unsupported_version": "This version does not support starting the MCP HTTP server",
@@ -2619,6 +2623,8 @@
"app.shortcuts.action.duplicateCurrentLine.label": "Duplicate Current Line Below",
"app.shortcuts.action.formatSql.description": "Format SQL in the current query editor",
"app.shortcuts.action.formatSql.label": "Format SQL",
"app.shortcuts.action.triggerSqlAiCompletion.description": "Manually request AI inline completion in the current SQL editor",
"app.shortcuts.action.triggerSqlAiCompletion.label": "Trigger SQL AI Completion",
"app.shortcuts.action.selectCurrentStatement.description": "Select the line at the cursor in the query editor and copy it to the clipboard",
"app.shortcuts.action.selectCurrentStatement.label": "Select Current Line and Copy",
"app.shortcuts.action.sendAIChatMessage.description": "Send the current message from the AI input; Shift+Enter always inserts a new line",

View File

@@ -1643,11 +1643,15 @@
"ai_settings.form.model_list_placeholder": "モデル ID を指定します。空欄の場合はサーバーから取得します",
"ai_settings.form.model_list_placeholder.codebuddy": "任意:よく使うモデルを事前入力できます。空欄なら CodeBuddy CLI またはサービス側で自動選択します",
"ai_settings.form.model_list_placeholder.cursor": "任意:よく使う Cursor モデル ID を事前入力できます。空欄なら Cursor の既定モデルを自動選択します",
"ai_settings.form.inline_completion_model": "自動補完モデル",
"ai_settings.form.inline_completion_model_hint": "SQL エディタのゴースト補完には、小さく高速なモデルを選べます。空欄の場合はチャットモデルに従います。",
"ai_settings.form.inline_completion_model_placeholder": "チャットモデルに従う",
"ai_settings.form.provider_name": "プロバイダー名",
"ai_settings.form.provider_name_placeholder": "例:自前の OpenAI 互換端点 / 専用モデル",
"ai_settings.form.provider_name_required": "名前を入力してください",
"ai_settings.form.section.auth_connection": "認証と接続",
"ai_settings.form.section.basic": "基本情報",
"ai_settings.form.section.inline_completion": "SQL 自動補完",
"ai_settings.form.section.service_type": "サービス種別",
"ai_settings.mcp_http.error.control_unsupported_runtime": "現在のランタイムでは MCP HTTP サービスの制御に対応していません",
"ai_settings.mcp_http.error.start_unsupported_version": "現在のバージョンでは MCP HTTP サービスの起動に対応していません",
@@ -2619,6 +2623,8 @@
"app.shortcuts.action.duplicateCurrentLine.label": "現在の行を下に複製",
"app.shortcuts.action.formatSql.description": "現在のクエリエディターの SQL を整形します",
"app.shortcuts.action.formatSql.label": "SQL を整形",
"app.shortcuts.action.triggerSqlAiCompletion.description": "現在の SQL エディターで AI インライン補完を手動で要求します",
"app.shortcuts.action.triggerSqlAiCompletion.label": "SQL AI 補完を実行",
"app.shortcuts.action.selectCurrentStatement.description": "クエリエディターでカーソル位置の行を選択してクリップボードにコピーします",
"app.shortcuts.action.selectCurrentStatement.label": "現在の行を選択してコピー",
"app.shortcuts.action.sendAIChatMessage.description": "AI 入力欄の現在のメッセージを送信します。Shift+Enter は常に改行します",

View File

@@ -1643,11 +1643,15 @@
"ai_settings.form.model_list_placeholder": "Укажите ID моделей; оставьте пустым, чтобы получить их с сервера",
"ai_settings.form.model_list_placeholder.codebuddy": "Необязательно: заранее укажите частые модели; если оставить пустым, CodeBuddy CLI или сервис выберет автоматически",
"ai_settings.form.model_list_placeholder.cursor": "Необязательно: заранее укажите частые ID моделей Cursor; если оставить пустым, автоматически будет выбрана модель Cursor по умолчанию",
"ai_settings.form.inline_completion_model": "Модель автодополнения",
"ai_settings.form.inline_completion_model_hint": "Выберите более маленькую и быструю модель для серых подсказок SQL-редактора. Оставьте пустым, чтобы использовать модель чата.",
"ai_settings.form.inline_completion_model_placeholder": "Использовать модель чата",
"ai_settings.form.provider_name": "Имя поставщика",
"ai_settings.form.provider_name_placeholder": "Пример: собственная OpenAI-совместимая конечная точка / частная модель",
"ai_settings.form.provider_name_required": "Введите имя",
"ai_settings.form.section.auth_connection": "Аутентификация и подключение",
"ai_settings.form.section.basic": "Основная информация",
"ai_settings.form.section.inline_completion": "SQL-автодополнение",
"ai_settings.form.section.service_type": "Тип сервиса",
"ai_settings.mcp_http.error.control_unsupported_runtime": "Текущая среда выполнения не поддерживает управление службой MCP HTTP",
"ai_settings.mcp_http.error.start_unsupported_version": "Эта версия не поддерживает запуск службы MCP HTTP",
@@ -2619,6 +2623,8 @@
"app.shortcuts.action.duplicateCurrentLine.label": "Дублировать текущую строку ниже",
"app.shortcuts.action.formatSql.description": "Форматировать SQL в текущем редакторе запросов",
"app.shortcuts.action.formatSql.label": "Форматировать SQL",
"app.shortcuts.action.triggerSqlAiCompletion.description": "Вручную запросить AI-автодополнение в текущем SQL-редакторе",
"app.shortcuts.action.triggerSqlAiCompletion.label": "Запустить AI-автодополнение SQL",
"app.shortcuts.action.selectCurrentStatement.description": "Выбрать строку под курсором в редакторе запросов и скопировать ее в буфер обмена",
"app.shortcuts.action.selectCurrentStatement.label": "Выбрать текущую строку и скопировать",
"app.shortcuts.action.sendAIChatMessage.description": "Отправить текущее сообщение из поля ввода AI; Shift+Enter всегда вставляет новую строку",

View File

@@ -1643,11 +1643,15 @@
"ai_settings.form.model_list_placeholder": "配置指定的模型 ID留空则默认从服务端拉取",
"ai_settings.form.model_list_placeholder.codebuddy": "可选:预填常用模型;留空则由 CodeBuddy CLI 或服务端自动选择",
"ai_settings.form.model_list_placeholder.cursor": "可选:预填常用 Cursor 模型 ID留空则由 Cursor 默认模型自动选择",
"ai_settings.form.inline_completion_model": "自动补全模型",
"ai_settings.form.inline_completion_model_hint": "建议选择更小、更快的模型用于 SQL 编辑器灰色联想。留空则跟随聊天模型。",
"ai_settings.form.inline_completion_model_placeholder": "跟随聊天模型",
"ai_settings.form.provider_name": "供应商名称",
"ai_settings.form.provider_name_placeholder": "例如:我的自建 OpenAI / 专属大模型",
"ai_settings.form.provider_name_required": "请输入名称",
"ai_settings.form.section.auth_connection": "认证与连接",
"ai_settings.form.section.basic": "基本信息",
"ai_settings.form.section.inline_completion": "SQL 自动补全",
"ai_settings.form.section.service_type": "服务类型",
"ai_settings.mcp_http.error.control_unsupported_runtime": "当前运行时暂不支持 MCP HTTP 服务控制",
"ai_settings.mcp_http.error.start_unsupported_version": "当前版本暂不支持启动 MCP HTTP 服务",
@@ -2619,6 +2623,8 @@
"app.shortcuts.action.duplicateCurrentLine.label": "复制当前行到下一行",
"app.shortcuts.action.formatSql.description": "格式化当前查询编辑器中的 SQL",
"app.shortcuts.action.formatSql.label": "美化 SQL",
"app.shortcuts.action.triggerSqlAiCompletion.description": "在当前 SQL 编辑器中手动请求 AI 灰色自动补全",
"app.shortcuts.action.triggerSqlAiCompletion.label": "触发 SQL AI 自动补全",
"app.shortcuts.action.selectCurrentStatement.description": "在查询编辑器中选中光标所在行并复制到剪贴板",
"app.shortcuts.action.selectCurrentStatement.label": "选择当前行并复制",
"app.shortcuts.action.sendAIChatMessage.description": "在 AI 输入框中发送当前消息Shift+Enter 始终换行",

View File

@@ -1643,11 +1643,15 @@
"ai_settings.form.model_list_placeholder": "設定指定的模型 ID留空則預設從服務端拉取",
"ai_settings.form.model_list_placeholder.codebuddy": "可選:預填常用模型;留空則由 CodeBuddy CLI 或服務端自動選擇",
"ai_settings.form.model_list_placeholder.cursor": "可選:預填常用 Cursor 模型 ID留空則由 Cursor 預設模型自動選擇",
"ai_settings.form.inline_completion_model": "自動補全模型",
"ai_settings.form.inline_completion_model_hint": "建議選擇更小、更快的模型用於 SQL 編輯器灰色聯想。留空則跟隨聊天模型。",
"ai_settings.form.inline_completion_model_placeholder": "跟隨聊天模型",
"ai_settings.form.provider_name": "供應商名稱",
"ai_settings.form.provider_name_placeholder": "例如:我的自建 OpenAI / 專屬大模型",
"ai_settings.form.provider_name_required": "請輸入名稱",
"ai_settings.form.section.auth_connection": "認證與連線",
"ai_settings.form.section.basic": "基本資訊",
"ai_settings.form.section.inline_completion": "SQL 自動補全",
"ai_settings.form.section.service_type": "服務類型",
"ai_settings.mcp_http.error.control_unsupported_runtime": "目前執行階段暫不支援 MCP HTTP 服務控制",
"ai_settings.mcp_http.error.start_unsupported_version": "目前版本暫不支援啟動 MCP HTTP 服務",
@@ -2619,6 +2623,8 @@
"app.shortcuts.action.duplicateCurrentLine.label": "複製目前行到下一行",
"app.shortcuts.action.formatSql.description": "格式化目前查詢編輯器中的 SQL",
"app.shortcuts.action.formatSql.label": "美化 SQL",
"app.shortcuts.action.triggerSqlAiCompletion.description": "在目前 SQL 編輯器中手動請求 AI 灰色自動補全",
"app.shortcuts.action.triggerSqlAiCompletion.label": "觸發 SQL AI 自動補全",
"app.shortcuts.action.selectCurrentStatement.description": "在查詢編輯器中選取游標所在行並複製到剪貼簿",
"app.shortcuts.action.selectCurrentStatement.label": "選取目前行並複製",
"app.shortcuts.action.sendAIChatMessage.description": "在 AI 輸入框中送出目前訊息Shift+Enter 一律換行",