File tree Expand file tree Collapse file tree
vscode-ng-language-service/client/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import {
3131 isNotTypescriptOrSupportedDecoratorField ,
3232 isNotTypescriptOrSupportedDecoratorRange ,
3333} from './embedded_support' ;
34+ import { OpenJsDocLinkCommandId } from '../../common/initialize' ;
3435
3536interface GetTcbResponse {
3637 uri : vscode . Uri ;
@@ -96,7 +97,9 @@ export class AngularLanguageClient implements vscode.Disposable {
9697 revealOutputChannelOn : lsp . RevealOutputChannelOn . Never ,
9798 outputChannel : this . outputChannel ,
9899 markdown : {
99- isTrusted : true ,
100+ isTrusted : {
101+ enabledCommands : [ OpenJsDocLinkCommandId ] ,
102+ } ,
100103 } ,
101104 middleware : {
102105 provideCodeActions : async (
Original file line number Diff line number Diff line change @@ -189,9 +189,12 @@ function openJsDocLinkCommand(): Command<OpenJsDocLinkCommand_Args> {
189189 id : OpenJsDocLinkCommandId ,
190190 isTextEditorCommand : false ,
191191 async execute ( args ) {
192- return await vscode . commands . executeCommand ( 'vscode.open' , vscode . Uri . parse ( args . file ) , <
193- vscode . TextDocumentShowOptions
194- > {
192+ if ( ! args ?. file ) {
193+ return ;
194+ }
195+ const uri = vscode . Uri . parse ( args . file ) ;
196+ const document = await vscode . workspace . openTextDocument ( uri ) ;
197+ return await vscode . window . showTextDocument ( document , {
195198 selection : new vscode . Range (
196199 new vscode . Position ( args . position ?. start . line ?? 0 , args . position ?. start . character ?? 0 ) ,
197200 new vscode . Position ( args . position ?. end . line ?? 0 , args . position ?. end . character ?? 0 ) ,
You can’t perform that action at this time.
0 commit comments