feat(editor): preselect the first completion candidate
This commit is contained in:
3 files changed
+7
-7
No files matched your search
+3
-3
@@ -132,11 +132,11 @@ describe("normalizeEditorSettings", () => {
|
|||||||
expect(normalizeEditorSettings({ insertSpaceAfterCompletion: false }).insertSpaceAfterCompletion).toBe(false);
|
expect(normalizeEditorSettings({ insertSpaceAfterCompletion: false }).insertSpaceAfterCompletion).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("keeps non-intrusive completion selection as the default", () => {
|
it("selects the first completion candidate by default and preserves the opt-out", () => {
|
||||||
expect(normalizeEditorSettings({}).selectFirstCompletionOnOpen).toBe(false);
|
expect(normalizeEditorSettings({}).selectFirstCompletionOnOpen).toBe(true);
|
||||||
expect(normalizeEditorSettings({ selectFirstCompletionOnOpen: true }).selectFirstCompletionOnOpen).toBe(true);
|
expect(normalizeEditorSettings({ selectFirstCompletionOnOpen: true }).selectFirstCompletionOnOpen).toBe(true);
|
||||||
expect(normalizeEditorSettings({ selectFirstCompletionOnOpen: false }).selectFirstCompletionOnOpen).toBe(false);
|
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", () => {
|
it("defaults sidebar connection sorting to manual order and preserves valid alphabetical modes", () => {
|
||||||
|
|||||||
@@ -746,7 +746,7 @@ export const DEFAULT_EDITOR_SETTINGS: EditorSettings = {
|
|||||||
autoAliasTables: true,
|
autoAliasTables: true,
|
||||||
insertSpaceAfterCompletion: true,
|
insertSpaceAfterCompletion: true,
|
||||||
sortCompletionColumnsAlphabetically: true,
|
sortCompletionColumnsAlphabetically: true,
|
||||||
selectFirstCompletionOnOpen: false,
|
selectFirstCompletionOnOpen: true,
|
||||||
wordWrap: false,
|
wordWrap: false,
|
||||||
tableDdlWordWrap: true,
|
tableDdlWordWrap: true,
|
||||||
vimModeEnabled: false,
|
vimModeEnabled: false,
|
||||||
|
|||||||
+3
-3
@@ -51,8 +51,8 @@ test("round-trips completion column ordering through the editor settings draft",
|
|||||||
|
|
||||||
test("round-trips completion selection behavior through the editor settings draft", () => {
|
test("round-trips completion selection behavior through the editor settings draft", () => {
|
||||||
const base = editorSettingsDraftFromSettings(DEFAULT_EDITOR_SETTINGS);
|
const base = editorSettingsDraftFromSettings(DEFAULT_EDITOR_SETTINGS);
|
||||||
const patch = editorSettingsPatchFromDraft({ ...base, selectFirstCompletionOnOpen: true }, base);
|
const patch = editorSettingsPatchFromDraft({ ...base, selectFirstCompletionOnOpen: false }, base);
|
||||||
|
|
||||||
assert.deepEqual(patch, { selectFirstCompletionOnOpen: true });
|
assert.deepEqual(patch, { selectFirstCompletionOnOpen: false });
|
||||||
assert.equal(editorSettingsDraftFromSettings({ ...DEFAULT_EDITOR_SETTINGS, ...patch }).selectFirstCompletionOnOpen, true);
|
assert.equal(editorSettingsDraftFromSettings({ ...DEFAULT_EDITOR_SETTINGS, ...patch }).selectFirstCompletionOnOpen, false);
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user