Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes/No <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.74.2 OS Version: Steps to Reproduce: the project in In the , enable completeBracketPairs. ! the project an empty .ts file and type you hit Enter, the prediction you see on the screen will be . Note the curly brace is closed. type along the prediction, when you type , Intellisense will select but despite this, the prediction gets dismissed. The expected behavior is that inline prediction stays because Intellisense item is the same. ! bug happens specifically when there are brackets are autoclosed by completeBracketPairs. I investigated further and noticed was returning false. For the above example, the was [4,6]-[4,7] whereas the was [4,6]-[4,6]. My suspicion for why was ending with [4,7] was that it's because 1 brace was by completeBracketPairs, the range is incremented by 1. But even if completeBracketPairs adds 2 braces, the range remains [4,7]. cc
You want these two internal settings enabled in btw "editor.inlineSuggest.allowQuickSuggestions": true, "editor.inlineSuggest.allowSuggestOnTriggerCharacters": true,
I did some more investigation. The was ending with [4,7] because the buffer text was so that makes sense. I noticed another place where the causes an issue ! ! is in the Intellisense menu but doesn't get preselected. Here, the is [2,1] -[2,6] whereas the was [2,6] -[2,6].
Hey folks, happy new year. Checking in here to help with planning on our end - are we in a spot to say whether this will make it in for Jan 2023 iteration? It's the last issue before we go to market. -A
As per convo between Henning & Jui: the behaviour will be redesigned, this issue hasn't been looked at yet:
This particular situation was not supported before, also the docs stated that this wouldn't work. Anyway, I changed it sligthly so that this case should work now. I also fixed some other issues (regarding suggest widget preselection).
to , and set the settings listed in in the user settings JSON file, because they don't show up in the Settings editor. the inline completions sample extension from vscode-extension-samples. I had to made sure the extension sample was using the proposed inlineCompletionsAdditions API and use and to fetch the newest APIs. the extension. a new ts file and type . Press enter, and an inline completion should show up. . :bug: The inline completion collapses.
I ran the repro steps in the latest Insiders Version: 1.75.0-insider (user setup) Commit: Date: 2023-01-27T22:17:10.413Z The bug that I had initially reported seems to have been fixed however, it didn't fix the problem entirely. ! When I type , inline and intellisense stay but when I finish typing , inline gets dismissed.
The case of "when inline completion is on the screen and the user overtypes, intellisense should show with the prefix of the inline completion pre-selected in intellisense" is supported by the two hidden settings ("editor.inlineSuggest.allowQuickSuggestions": true, "editor.inlineSuggest.allowSuggestOnTriggerCharacters": true). The bug I filed is a subset of this.
Can be reproduced in : ! Fixed in upcoming version (just select the newest version in the playground): !
! looks correct to me!

Discussion:
import { MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser'; import { EditorOption } from 'vs/editor/common/config/editorOptions'; <ins> import { Range } from 'vs/editor/common/core/range'; </ins> import { CompletionItemKind, InlineCompletionTriggerKind, SelectedSuggestionInfo } from 'vs/editor/common/languages'; import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; import { SharedInlineCompletionCache } from 'vs/editor/contrib/inlineCompletions/browser/ghostTextModel';

const isAugmentedCompletionValid = augmentedCompletion && suggestInlineCompletion <ins> // The intellisense completion must be a prefix of the augmented completion </ins> && augmentedCompletion.insertText.startsWith(suggestInlineCompletion.insertText) <del> && augmentedCompletion.range.equalsRange(suggestInlineCompletion.range); </del> <ins> // The augmented completion must replace the intellisense completion range, but can replace even more && rangeExtends(augmentedCompletion.range, suggestInlineCompletion.range); </ins> if (!isSuggestionPreviewEnabled && !isAugmentedCompletionValid) { return undefined;

function sum(arr: number[]): number { return arr.reduce((a, b) => a + b, 0); } <ins> function rangeExtends(extendingRange: Range, rangeToExtend: Range): boolean { return extendingRange.startLineNumber === rangeToExtend.startLineNumber && extendingRange.startColumn === rangeToExtend.startColumn && ((extendingRange.endLineNumber === rangeToExtend.endLineNumber && extendingRange.endColumn >= rangeToExtend.endColumn) || extendingRange.endLineNumber > rangeToExtend.endLineNumber); } </ins>