fix: save tsEntry.data for resolveCompletionItem (#294)

close #293
This commit is contained in:
Heyward Fann 2021-06-04 18:53:46 +08:00 committed by GitHub
parent cd624aa05e
commit e7cdffd8d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -222,7 +222,7 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
): Promise<CompletionItem> {
if (item == null) return undefined
let { uri, position, source, name } = item.data
let { uri, position, source, name, data } = item.data
const filepath = this.client.toPath(uri)
if (!filepath) return undefined
let document = workspace.getDocument(uri)
@ -232,7 +232,7 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
filepath,
position
),
entryNames: [source ? { name, source } : name]
entryNames: [source ? { name, source, data } : name]
}
let response: ServerResponse.Response<Proto.CompletionDetailsResponse>

View file

@ -106,6 +106,7 @@ export function convertCompletionEntry(
uri,
position,
name: tsEntry.name,
data: tsEntry.data,
source: tsEntry.source || ''
}
}