feat(editor): show column hints for INSERT values

This commit is contained in:
Freedom authored and GitHub committed 2026-07-13 00:39:36 +08:00
1 parent ff570d5268
commit 86dad5db9f
18 files changed
+1076 -5

No files matched your search

@@ -18,6 +18,14 @@ describe("normalizeEditorSettings", () => {
expect(normalizeEditorSettings({ showCurrentStatementFrame: false }).showCurrentStatementFrame).toBe(false);
});
it("shows INSERT value column hints by default", () => {
expect(normalizeEditorSettings({}).showInsertValueHints).toBe(true);
});
it("preserves disabled INSERT value column hints", () => {
expect(normalizeEditorSettings({ showInsertValueHints: false }).showInsertValueHints).toBe(false);
});
it("keeps SQL semantic diagnostics in auto mode and disabled by default", () => {
const settings = normalizeEditorSettings({});
expect(settings.sqlSemanticDiagnosticsMode).toBe("auto");
+4
View File
@@ -375,6 +375,7 @@ export interface EditorSettings {
showExecutionTargetPicker: boolean;
showStatementRunButtons: boolean;
showCurrentStatementFrame: boolean;
showInsertValueHints: boolean;
autoAliasTables: boolean;
wordWrap: boolean;
vimModeEnabled: boolean;
@@ -509,6 +510,7 @@ export const DEFAULT_EDITOR_SETTINGS: EditorSettings = {
showExecutionTargetPicker: false,
showStatementRunButtons: true,
showCurrentStatementFrame: true,
showInsertValueHints: true,
autoAliasTables: true,
wordWrap: false,
vimModeEnabled: false,
@@ -743,6 +745,7 @@ export function normalizeEditorSettings(settings: Partial<EditorSettings>, exist
showExecutionTargetPicker: settings.showExecutionTargetPicker ?? DEFAULT_EDITOR_SETTINGS.showExecutionTargetPicker,
showStatementRunButtons: typeof settings.showStatementRunButtons === "boolean" ? settings.showStatementRunButtons : DEFAULT_EDITOR_SETTINGS.showStatementRunButtons,
showCurrentStatementFrame: typeof settings.showCurrentStatementFrame === "boolean" ? settings.showCurrentStatementFrame : DEFAULT_EDITOR_SETTINGS.showCurrentStatementFrame,
showInsertValueHints: typeof settings.showInsertValueHints === "boolean" ? settings.showInsertValueHints : DEFAULT_EDITOR_SETTINGS.showInsertValueHints,
autoAliasTables: settings.autoAliasTables ?? DEFAULT_EDITOR_SETTINGS.autoAliasTables,
wordWrap: settings.wordWrap ?? DEFAULT_EDITOR_SETTINGS.wordWrap,
vimModeEnabled: typeof settings.vimModeEnabled === "boolean" ? settings.vimModeEnabled : DEFAULT_EDITOR_SETTINGS.vimModeEnabled,
@@ -985,6 +988,7 @@ export const useSettingsStore = defineStore("settings", () => {
if (partial.showExecutionTargetPicker !== undefined) editorSettings.value.showExecutionTargetPicker = partial.showExecutionTargetPicker;
if (partial.showStatementRunButtons !== undefined) editorSettings.value.showStatementRunButtons = partial.showStatementRunButtons === true;
if (partial.showCurrentStatementFrame !== undefined) editorSettings.value.showCurrentStatementFrame = partial.showCurrentStatementFrame === true;
if (partial.showInsertValueHints !== undefined) editorSettings.value.showInsertValueHints = partial.showInsertValueHints === true;
if (partial.autoAliasTables !== undefined) editorSettings.value.autoAliasTables = partial.autoAliasTables;
if (partial.wordWrap !== undefined) editorSettings.value.wordWrap = partial.wordWrap;
if (partial.vimModeEnabled !== undefined) editorSettings.value.vimModeEnabled = partial.vimModeEnabled === true;