* Proxy command for opening links in jsdoc comments. * * This is needed to avoid VS Code incorrectly rewriting file names.
()
| 185 | * This is needed to avoid VS Code incorrectly rewriting file names. |
| 186 | */ |
| 187 | function openJsDocLinkCommand(): Command<OpenJsDocLinkCommand_Args> { |
| 188 | return { |
| 189 | id: OpenJsDocLinkCommandId, |
| 190 | isTextEditorCommand: false, |
| 191 | async execute(args) { |
| 192 | if (typeof args?.file !== 'string' || args.file.length === 0) { |
| 193 | return; |
| 194 | } |
| 195 | // Command URI arguments are untrusted. This value is a filesystem path, so use `Uri.file` |
| 196 | // to prevent URI schemes from selecting another VS Code resource provider. |
| 197 | // https://code.visualstudio.com/api/references/vscode-api#Uri.file |
| 198 | const uri = vscode.Uri.file(args.file); |
| 199 | const document = await vscode.workspace.openTextDocument(uri); |
| 200 | return await vscode.window.showTextDocument(document, { |
| 201 | selection: new vscode.Range( |
| 202 | new vscode.Position(args.position?.start.line ?? 0, args.position?.start.character ?? 0), |
| 203 | new vscode.Position(args.position?.end.line ?? 0, args.position?.end.character ?? 0), |
| 204 | ), |
| 205 | }); |
| 206 | }, |
| 207 | }; |
| 208 | } |
| 209 | |
| 210 | function applyCodeActionCommand(ngClient: AngularLanguageClient): Command { |
| 211 | return { |