Johannes Rieken 2024-05-27 11:16:22 +02:00 committed by GitHub
parent f80875f681
commit e3b7a27662
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,6 +18,7 @@ import { Range } from 'vs/editor/common/core/range';
import { Selection } from 'vs/editor/common/core/selection';
import { SingleTextEdit, TextEdit } from 'vs/editor/common/core/textEdit';
import { TextLength } from 'vs/editor/common/core/textLength';
import { ScrollType } from 'vs/editor/common/editorCommon';
import { Command, InlineCompletionContext, InlineCompletionTriggerKind, PartialAcceptTriggerKind } from 'vs/editor/common/languages';
import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry';
import { EndOfLinePreference, ITextModel } from 'vs/editor/common/model';
@ -444,6 +445,7 @@ export class InlineCompletionsModel extends Disposable {
const selections = getEndPositionsAfterApplying(edits).map(p => Selection.fromPositions(p));
editor.executeEdits('inlineSuggestion.accept', edits.map(edit => EditOperation.replace(edit.range, edit.text)));
editor.setSelections(selections, 'inlineCompletionPartialAccept');
editor.revealPositionInCenterIfOutsideViewport(editor.getPosition()!, ScrollType.Immediate);
} finally {
this._isAcceptingPartially = false;
}