77 languages ,
88 Uri ,
99 window as Window ,
10- env
10+ env , WebviewPanel
1111} from 'vscode' ;
1212import * as cli from './cli' ;
1313import { CodeQLCliServer } from './cli' ;
@@ -341,6 +341,8 @@ export class ResultsView extends AbstractWebview<IntoResultsViewMsg, FromResults
341341 return ;
342342 }
343343
344+ const panel = await this . getPanel ( ) ;
345+
344346 this . _interpretation = undefined ;
345347 const interpretationPage = await this . interpretResultsInfo (
346348 fullQuery . completedQuery . query ,
@@ -350,12 +352,11 @@ export class ResultsView extends AbstractWebview<IntoResultsViewMsg, FromResults
350352 const sortedResultsMap : SortedResultsMap = { } ;
351353 Object . entries ( fullQuery . completedQuery . sortedResultsInfo ) . forEach (
352354 ( [ k , v ] ) =>
353- ( sortedResultsMap [ k ] = this . convertPathPropertiesToWebviewUris ( v ) )
355+ ( sortedResultsMap [ k ] = this . convertPathPropertiesToWebviewUris ( panel , v ) )
354356 ) ;
355357
356358 this . _displayedQuery = fullQuery ;
357359
358- const panel = this . getPanel ( ) ;
359360 await this . waitForPanelLoaded ( ) ;
360361 if ( ! panel . visible ) {
361362 if ( forceReveal === WebviewReveal . Forced ) {
@@ -426,6 +427,7 @@ export class ResultsView extends AbstractWebview<IntoResultsViewMsg, FromResults
426427 interpretation : interpretationPage ,
427428 origResultsPaths : fullQuery . completedQuery . query . resultsPaths ,
428429 resultsPath : this . convertPathToWebviewUri (
430+ panel ,
429431 fullQuery . completedQuery . query . resultsPaths . resultsPath
430432 ) ,
431433 parsedResultSets,
@@ -498,10 +500,12 @@ export class ResultsView extends AbstractWebview<IntoResultsViewMsg, FromResults
498500 throw new Error ( 'trying to view a page of a query that is not loaded' ) ;
499501 }
500502
503+ const panel = await this . getPanel ( ) ;
504+
501505 const sortedResultsMap : SortedResultsMap = { } ;
502506 Object . entries ( results . completedQuery . sortedResultsInfo ) . forEach (
503507 ( [ k , v ] ) =>
504- ( sortedResultsMap [ k ] = this . convertPathPropertiesToWebviewUris ( v ) )
508+ ( sortedResultsMap [ k ] = this . convertPathPropertiesToWebviewUris ( panel , v ) )
505509 ) ;
506510
507511 const resultSetSchemas = await this . getResultSetSchemas ( results . completedQuery , sorted ? selectedTable : '' ) ;
@@ -544,6 +548,7 @@ export class ResultsView extends AbstractWebview<IntoResultsViewMsg, FromResults
544548 interpretation : this . _interpretation ,
545549 origResultsPaths : results . completedQuery . query . resultsPaths ,
546550 resultsPath : this . convertPathToWebviewUri (
551+ panel ,
547552 results . completedQuery . query . resultsPaths . resultsPath
548553 ) ,
549554 parsedResultSets,
@@ -812,15 +817,16 @@ export class ResultsView extends AbstractWebview<IntoResultsViewMsg, FromResults
812817 this . _diagnosticCollection . set ( diagnostics ) ;
813818 }
814819
815- private convertPathToWebviewUri ( path : string ) : string {
816- return fileUriToWebviewUri ( this . getPanel ( ) , Uri . file ( path ) ) ;
820+ private convertPathToWebviewUri ( panel : WebviewPanel , path : string ) : string {
821+ return fileUriToWebviewUri ( panel , Uri . file ( path ) ) ;
817822 }
818823
819824 private convertPathPropertiesToWebviewUris (
825+ panel : WebviewPanel ,
820826 info : SortedResultSetInfo
821827 ) : SortedResultSetInfo {
822828 return {
823- resultsPath : this . convertPathToWebviewUri ( info . resultsPath ) ,
829+ resultsPath : this . convertPathToWebviewUri ( panel , info . resultsPath ) ,
824830 sortState : info . sortState ,
825831 } ;
826832 }
0 commit comments