Skip to content

Commit 5bde174

Browse files
authored
Fix incorrect typings in OpenJsDocLinkCommand_Args (microsoft#209872)
Fix incorrect typings in OpenJsDocLinkCommand_Args
1 parent 18c74e3 commit 5bde174

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

extensions/typescript-language-features/src/commands/openJsDocLink.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,17 @@ import * as vscode from 'vscode';
77
import { Command } from './commandManager';
88

99
export interface OpenJsDocLinkCommand_Args {
10-
readonly file: vscode.Uri;
11-
readonly position: vscode.Position;
10+
readonly file: {
11+
readonly scheme: string;
12+
readonly authority?: string;
13+
readonly path?: string;
14+
readonly query?: string;
15+
readonly fragment?: string;
16+
};
17+
readonly position: {
18+
readonly line: number;
19+
readonly character: number;
20+
};
1221
}
1322

1423
/**
@@ -21,8 +30,10 @@ export class OpenJsDocLinkCommand implements Command {
2130
public readonly id = OpenJsDocLinkCommand.id;
2231

2332
public async execute(args: OpenJsDocLinkCommand_Args): Promise<void> {
33+
const { line, character } = args.position;
34+
const position = new vscode.Position(line, character);
2435
await vscode.commands.executeCommand('vscode.open', vscode.Uri.from(args.file), <vscode.TextDocumentShowOptions>{
25-
selection: new vscode.Range(args.position, args.position),
36+
selection: new vscode.Range(position, position),
2637
});
2738
}
2839
}

0 commit comments

Comments
 (0)