Fix incorrect typings in OpenJsDocLinkCommand_Args (#209872)

Fix incorrect typings in OpenJsDocLinkCommand_Args
This commit is contained in:
Vladimir Piskarev 2024-04-08 23:09:49 +03:00 committed by GitHub
parent 18c74e3c9d
commit 5bde174ef1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,8 +7,17 @@ import * as vscode from 'vscode';
import { Command } from './commandManager';
export interface OpenJsDocLinkCommand_Args {
readonly file: vscode.Uri;
readonly position: vscode.Position;
readonly file: {
readonly scheme: string;
readonly authority?: string;
readonly path?: string;
readonly query?: string;
readonly fragment?: string;
};
readonly position: {
readonly line: number;
readonly character: number;
};
}
/**
@ -21,8 +30,10 @@ export class OpenJsDocLinkCommand implements Command {
public readonly id = OpenJsDocLinkCommand.id;
public async execute(args: OpenJsDocLinkCommand_Args): Promise<void> {
const { line, character } = args.position;
const position = new vscode.Position(line, character);
await vscode.commands.executeCommand('vscode.open', vscode.Uri.from(args.file), <vscode.TextDocumentShowOptions>{
selection: new vscode.Range(args.position, args.position),
selection: new vscode.Range(position, position),
});
}
}