🐛 fix error getting type definitions for autocomplete
This commit is contained in:
parent
f67d6f111d
commit
02bce50f11
1 changed files with 3 additions and 3 deletions
|
|
@ -70,19 +70,19 @@ export function setupStatusBar(
|
|||
}
|
||||
|
||||
async function getDefinition(
|
||||
filepath: string,
|
||||
uri: string,
|
||||
line: number,
|
||||
character: number
|
||||
): Promise<AutocompleteSnippet | undefined> {
|
||||
const definitions = (await vscode.commands.executeCommand(
|
||||
"vscode.executeDefinitionProvider",
|
||||
vscode.Uri.file(filepath),
|
||||
vscode.Uri.parse(uri),
|
||||
new vscode.Position(line, character)
|
||||
)) as any;
|
||||
|
||||
if (definitions[0]?.targetRange) {
|
||||
return {
|
||||
filepath,
|
||||
filepath: uri,
|
||||
content: await ideProtocolClient.readRangeInFile(
|
||||
definitions[0].targetUri.fsPath,
|
||||
definitions[0].targetRange
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue