diff --git a/src/vs/editor/contrib/suggest/browser/suggestModel.ts b/src/vs/editor/contrib/suggest/browser/suggestModel.ts index 15830f755379d..28feab3536279 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestModel.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestModel.ts @@ -72,7 +72,8 @@ export class LineContext { if (!word) { return false; } - if (word.endColumn !== pos.column) { + if (word.endColumn !== pos.column && + word.startColumn + 1 !== pos.column /* after typing a single character before a word */) { return false; } if (!isNaN(Number(word.word))) { diff --git a/src/vs/editor/contrib/suggest/test/browser/suggestModel.test.ts b/src/vs/editor/contrib/suggest/test/browser/suggestModel.test.ts index f1c0f9c4b80c7..dfc149d409a1e 100644 --- a/src/vs/editor/contrib/suggest/test/browser/suggestModel.test.ts +++ b/src/vs/editor/contrib/suggest/test/browser/suggestModel.test.ts @@ -142,7 +142,7 @@ suite('SuggestModel - Context', function () { assertAutoTrigger(model, 3, true, 'end of word, Das|'); assertAutoTrigger(model, 4, false, 'no word Das |'); - assertAutoTrigger(model, 1, false, 'middle of word D|as'); + assertAutoTrigger(model, 1, true, 'typing a single character before a word: D|as'); assertAutoTrigger(model, 55, false, 'number, 1861|'); model.dispose(); }); @@ -157,7 +157,7 @@ suite('SuggestModel - Context', function () { assertAutoTrigger(model, 1, true, 'a| — should trigger at boundary between languages'); assertAutoTrigger(model, 5, false, 'a|a — should NOT trigger at start of word'); assertAutoTrigger(model, 6, true, 'aa|< — should trigger at end of word');