提交 659d646e 编写于 作者: M Matt Bierner

Use destructuring

上级 23d9f2ce
...@@ -309,20 +309,17 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider ...@@ -309,20 +309,17 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider
let msg: ReadonlyArray<Proto.CompletionEntry> | undefined = undefined; let msg: ReadonlyArray<Proto.CompletionEntry> | undefined = undefined;
try { try {
if (this.client.apiVersion.gte(API.v300)) { if (this.client.apiVersion.gte(API.v300)) {
const response = await this.client.execute('completionInfo', args, token); const { body } = await this.client.execute('completionInfo', args, token);
if (!response.body) { if (!body || body.isNewIdentifierLocation) {
return null; return null;
} }
if (response.body.isNewIdentifierLocation) { msg = body.entries;
return null;
}
msg = response.body.entries;
} else { } else {
const response = await this.client.execute('completions', args, token); const { body } = await this.client.execute('completions', args, token);
if (!response.body) { if (!body) {
return null; return null;
} }
msg = response.body; msg = body;
} }
} catch { } catch {
return null; return null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册