not throw error for No content available.
This commit is contained in:
parent
786cdcd252
commit
6c4e0d8a50
1 changed files with 12 additions and 5 deletions
|
@ -118,12 +118,19 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
|
||||||
|
|
||||||
let isNewIdentifierLocation = true
|
let isNewIdentifierLocation = true
|
||||||
if (this.client.apiVersion.gte(API.v300)) {
|
if (this.client.apiVersion.gte(API.v300)) {
|
||||||
|
try {
|
||||||
const response = await this.client.execute('completionInfo', args, token)
|
const response = await this.client.execute('completionInfo', args, token)
|
||||||
if (response.type !== 'response' || !response.body) {
|
if (response.type !== 'response' || !response.body) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
isNewIdentifierLocation = response.body.isNewIdentifierLocation
|
isNewIdentifierLocation = response.body.isNewIdentifierLocation
|
||||||
msg = response.body.entries
|
msg = response.body.entries
|
||||||
|
} catch (e) {
|
||||||
|
if (e.message == 'No content available.') {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
throw e
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const response = await this.client.execute('completions', args, token)
|
const response = await this.client.execute('completions', args, token)
|
||||||
msg = response.body
|
msg = response.body
|
||||||
|
|
Loading…
Add table
Reference in a new issue