mirror of
https://github.com/Microsoft/vscode
synced 2024-07-05 01:08:57 +00:00
Fix incorrect typings in OpenJsDocLinkCommand_Args
(#209872)
Fix incorrect typings in OpenJsDocLinkCommand_Args
This commit is contained in:
parent
18c74e3c9d
commit
5bde174ef1
|
@ -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),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user