File tree Expand file tree Collapse file tree
extensions/markdown-language-features/src/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,19 +43,21 @@ export class OpenDocumentLinkCommand implements Command {
4343 private readonly engine : MarkdownEngine
4444 ) { }
4545
46- public execute ( args : OpenDocumentLinkArgs ) {
46+ public async execute ( args : OpenDocumentLinkArgs ) {
4747 const fromResource = vscode . Uri . parse ( decodeURIComponent ( args . fromResource ) ) ;
4848 const targetPath = decodeURIComponent ( args . path ) ;
4949 const column = this . getViewColumn ( fromResource ) ;
50- return this . tryOpen ( targetPath , args , column ) . catch ( ( ) => {
50+ try {
51+ return await this . tryOpen ( targetPath , args , column ) ;
52+ } catch {
5153 if ( targetPath && extname ( targetPath ) === '' ) {
5254 return this . tryOpen ( targetPath + '.md' , args , column ) ;
5355 }
5456 const targetResource = vscode . Uri . file ( targetPath ) ;
55- return Promise . resolve ( undefined )
56- . then ( ( ) => vscode . commands . executeCommand ( 'vscode.open' , targetResource , column ) )
57- . then ( ( ) => undefined ) ;
58- } ) ;
57+ await Promise . resolve ( undefined ) ;
58+ await vscode . commands . executeCommand ( 'vscode.open' , targetResource , column ) ;
59+ return undefined ;
60+ }
5961 }
6062
6163 private async tryOpen ( path : string , args : OpenDocumentLinkArgs , column : vscode . ViewColumn ) {
You can’t perform that action at this time.
0 commit comments