feat(editor): preselect the first completion candidate

This commit is contained in:
zipg authored and GitHub committed 2026-08-26 21:31:54 +08:00
1 parent 589fbd9de8
commit e93b41a4ff
3 files changed
+7 -7

No files matched your search

+3 -3
View File
@@ -132,11 +132,11 @@ describe("normalizeEditorSettings", () => {
expect(normalizeEditorSettings({ insertSpaceAfterCompletion: false }).insertSpaceAfterCompletion).toBe(false);
});
it("keeps non-intrusive completion selection as the default", () => {
expect(normalizeEditorSettings({}).selectFirstCompletionOnOpen).toBe(false);
it("selects the first completion candidate by default and preserves the opt-out", () => {
expect(normalizeEditorSettings({}).selectFirstCompletionOnOpen).toBe(true);
expect(normalizeEditorSettings({ selectFirstCompletionOnOpen: true }).selectFirstCompletionOnOpen).toBe(true);
expect(normalizeEditorSettings({ selectFirstCompletionOnOpen: false }).selectFirstCompletionOnOpen).toBe(false);
expect(normalizeEditorSettings({ selectFirstCompletionOnOpen: "true" } as any).selectFirstCompletionOnOpen).toBe(false);
expect(normalizeEditorSettings({ selectFirstCompletionOnOpen: "true" } as any).selectFirstCompletionOnOpen).toBe(true);
});
it("defaults sidebar connection sorting to manual order and preserves valid alphabetical modes", () => {
+1 -1
View File
@@ -746,7 +746,7 @@ export const DEFAULT_EDITOR_SETTINGS: EditorSettings = {
autoAliasTables: true,
insertSpaceAfterCompletion: true,
sortCompletionColumnsAlphabetically: true,
selectFirstCompletionOnOpen: false,
selectFirstCompletionOnOpen: true,
wordWrap: false,
tableDdlWordWrap: true,
vimModeEnabled: false,