提交 363647b2 编写于 作者: J Johannes Rieken

fix #83400

上级 3a07de7c
......@@ -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: [],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册