mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 08:38:56 +01:00
fix #83400
This commit is contained in:
@@ -635,6 +635,12 @@ class SuggestAdapter {
|
||||
const doc = this._documents.getDocument(resource);
|
||||
const pos = typeConvert.Position.to(position);
|
||||
|
||||
// The default insert/replace ranges. It's important to compute them
|
||||
// before asynchronously asking the provider for its results. See
|
||||
// https://github.com/microsoft/vscode/issues/83400#issuecomment-546851421
|
||||
const replaceRange = doc.getWordRangeAtPosition(pos) || new Range(pos, pos);
|
||||
const insertRange = replaceRange.with({ end: pos });
|
||||
|
||||
return asPromise(() => this._provider.provideCompletionItems(doc, pos, token, typeConvert.CompletionContext.to(context))).then(value => {
|
||||
|
||||
if (!value) {
|
||||
@@ -655,10 +661,6 @@ class SuggestAdapter {
|
||||
const disposables = new DisposableStore();
|
||||
this._disposables.set(pid, disposables);
|
||||
|
||||
// the default text edit range
|
||||
const replaceRange = doc.getWordRangeAtPosition(pos) || new Range(pos, pos);
|
||||
const insertRange = replaceRange.with({ end: pos });
|
||||
|
||||
const result: extHostProtocol.ISuggestResultDto = {
|
||||
x: pid,
|
||||
b: [],
|
||||
|
||||
Reference in New Issue
Block a user