null -> undefined
This commit is contained in:
parent
bd54e5f5cc
commit
b255097c33
1 changed files with 5 additions and 5 deletions
|
@ -434,7 +434,7 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider<
|
||||||
position: vscode.Position,
|
position: vscode.Position,
|
||||||
token: vscode.CancellationToken,
|
token: vscode.CancellationToken,
|
||||||
context: vscode.CompletionContext
|
context: vscode.CompletionContext
|
||||||
): Promise<vscode.CompletionList<MyCompletionItem> | null> {
|
): Promise<vscode.CompletionList<MyCompletionItem> | undefined> {
|
||||||
if (this.typingsStatus.isAcquiringTypings) {
|
if (this.typingsStatus.isAcquiringTypings) {
|
||||||
return Promise.reject<vscode.CompletionList<MyCompletionItem>>({
|
return Promise.reject<vscode.CompletionList<MyCompletionItem>>({
|
||||||
label: localize(
|
label: localize(
|
||||||
|
@ -448,14 +448,14 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider<
|
||||||
|
|
||||||
const file = this.client.toOpenedFilePath(document);
|
const file = this.client.toOpenedFilePath(document);
|
||||||
if (!file) {
|
if (!file) {
|
||||||
return null;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const line = document.lineAt(position.line);
|
const line = document.lineAt(position.line);
|
||||||
const completionConfiguration = CompletionConfiguration.getConfigurationForResource(this.modeId, document.uri);
|
const completionConfiguration = CompletionConfiguration.getConfigurationForResource(this.modeId, document.uri);
|
||||||
|
|
||||||
if (!this.shouldTrigger(context, line, position)) {
|
if (!this.shouldTrigger(context, line, position)) {
|
||||||
return null;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const wordRange = document.getWordRangeAtPosition(position);
|
const wordRange = document.getWordRangeAtPosition(position);
|
||||||
|
@ -487,7 +487,7 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider<
|
||||||
|
|
||||||
if (response.type !== 'response' || !response.body) {
|
if (response.type !== 'response' || !response.body) {
|
||||||
this.logCompletionsTelemetry(duration, response);
|
this.logCompletionsTelemetry(duration, response);
|
||||||
return null;
|
return undefined;
|
||||||
}
|
}
|
||||||
isNewIdentifierLocation = response.body.isNewIdentifierLocation;
|
isNewIdentifierLocation = response.body.isNewIdentifierLocation;
|
||||||
isMemberCompletion = response.body.isMemberCompletion;
|
isMemberCompletion = response.body.isMemberCompletion;
|
||||||
|
@ -505,7 +505,7 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider<
|
||||||
} else {
|
} else {
|
||||||
const response = await this.client.interruptGetErr(() => this.client.execute('completions', args, token));
|
const response = await this.client.interruptGetErr(() => this.client.execute('completions', args, token));
|
||||||
if (response.type !== 'response' || !response.body) {
|
if (response.type !== 'response' || !response.body) {
|
||||||
return null;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
entries = response.body;
|
entries = response.body;
|
||||||
|
|
Loading…
Reference in a new issue