Change:
description: 'barTest' }); assert.strictEqual(result.suggestions[0].insertText, 's1'); <del> assert.strictEqual((result.suggestions[0].range as any).insert.startColumn, 1); </del> <ins> assert.strictEqual((result.suggestions[0].range as CompletionItemRanges).insert.startColumn, 1); </ins> assert.deepStrictEqual(result.suggestions[1].label, { label: 'bar-bar', description: 'name' }); assert.strictEqual(result.suggestions[1].insertText, 's2'); <del> assert.strictEqual((result.suggestions[1].range as any).insert.startColumn, 1); </del> <ins> assert.strictEqual((result.suggestions[1].range as CompletionItemRanges).insert.startColumn, 1); </ins> }); await provider.provideCompletionItems(model, new Position(1, 5), context)!.then(result => { assert.strictEqual(result.incomplete, undefined); <del> assert.strictEqual(result.suggestions.length, 1); assert.deepStrictEqual(result.suggestions[0].label, { </del> <ins> assert.strictEqual(result.suggestions.length, 2); const [first, second] = result.suggestions; assert.deepStrictEqual(first.label, { label: 'bar', description: 'barTest' }); assert.strictEqual(first.insertText, 's1'); assert.strictEqual((first.range as CompletionItemRanges).insert.startColumn, 5); assert.deepStrictEqual(second.label, { </ins> label: 'bar-bar', description: 'name' }); <del> assert.strictEqual(result.suggestions[0].insertText, 's2'); assert.strictEqual((result.suggestions[0].range as any).insert.startColumn, 1); </del> <ins> assert.strictEqual(second.insertText, 's2'); assert.strictEqual((second.range as CompletionItemRanges).insert.startColumn, 1); </ins> }); await provider.provideCompletionItems(model, new Position(1, 6), context)!.then(result => {

Discussion:
Issue Type: <bBug</bI would like the prefix to trigger only when there is a leading whitespace in front of the prefix (it is supposed to be substituted with an explicit non-breaking space character ). The example of the snippet: --The prefix behaves as if there is no leading space, meaning the remains one extra whitespace before the expanded body, resulting in a double space: . VS Code version: Code 1.55.2 (, 2021-04-13T09:35:57.887Z) OS version: WindowsNT x64 10.0. <details<summarySystem Info</summary </details<details<summaryExtensions (37)</summaryExtensionVersion ------ html-snippets0.2.1 Handlebars0.4.1 rc-beautify1.2.0 git-temporal-vscode1.0.0 insert-unicode0.10.0 i30.0.1 vscode-generate-getter-setter0.5.0 gitlens11.4.1 vscode-html-css1.10.2 vscode-npm-script0.3.21 carbon-now-sh1.2.0 vscode-angular-html1.7.0 beautify1.5.0 latex-workshop8.18.0 polacode-.5.2 svg1.4.6 Angular211.0.0 solidity0.0.113 Kotlin1.7.1 rainbow-csv1.8.1 vscode-docker1.12.1 python2021.5. vscode-pylance2021.5.2 jupyter2021.5. remote-containers0.166.1 postscript1.0.1 java0.79.1 LiveServer5.6.1 bash-debug0.3.9 scala0.5.3 bash-beautify0.1.1 code-settings-sync3.4.3 code-spell-checker1.10.2 sass-indented1.8.16 html-preview-vscode0.2.5 vscode-ruby0.28.0 markdown-all-in-one3.4.0 (2 theme extensions excluded) </details<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --
I have a fix for this but it makes bigger changes in how snippet completion are computed. Pushing out to November to get more Insider usage for it, changes are in