@@ -3,6 +3,7 @@ import * as path from "path";
3
3
import * as vscode from "vscode" ;
4
4
import { LanguageClient , LanguageClientOptions , ServerOptions } from "vscode-languageclient/node" ;
5
5
import { sleep , Mutex } from "./utils" ;
6
+ import openExternal = require( "open" ) ;
6
7
7
8
const LANGUAGE_SERVER_DEFAULT_TCP_PORT = 6610 ;
8
9
const LANGUAGE_SERVER_DEFAULT_HOST = "127.0.0.1" ;
@@ -45,7 +46,6 @@ let clientsMutex = new Mutex();
45
46
let clients : Map < string , LanguageClient > = new Map ( ) ;
46
47
47
48
async function updateLoadedDocumentClients ( uri ?: vscode . Uri | undefined ) {
48
- OUTPUT_CHANNEL . appendLine ( "initialze/restart all needed language clients." ) ;
49
49
await clientsMutex . dispatch ( async ( ) => {
50
50
for ( let client of clients . values ( ) ) {
51
51
await client . stop ( ) . catch ( ( _ ) => { } ) ;
@@ -481,6 +481,10 @@ async function attachPython(session: vscode.DebugSession, event: string, options
481
481
}
482
482
}
483
483
484
+ async function openReport ( file : string ) {
485
+ await openExternal ( file ) ;
486
+ }
487
+
484
488
async function onRobotExited ( session : vscode . DebugSession , outputFile ?: string , logFile ?: string , reportFile ?: string ) {
485
489
if ( reportFile ) {
486
490
let config = vscode . workspace . getConfiguration ( CONFIG_SECTION , session . workspaceFolder ) ;
@@ -489,7 +493,7 @@ async function onRobotExited(session: vscode.DebugSession, outputFile?: string,
489
493
case "disabled" :
490
494
return ;
491
495
case "external" :
492
- vscode . env . openExternal ( vscode . Uri . file ( reportFile ) ) ;
496
+ openReport ( reportFile ) ;
493
497
}
494
498
}
495
499
}
@@ -642,13 +646,13 @@ export async function activateAsync(context: vscode.ExtensionContext) {
642
646
643
647
switch ( config . get < string > ( "run.openReportAfterRun" ) ) {
644
648
default :
645
- vscode . env . openExternal ( vscode . Uri . file ( link . path ) ) ;
649
+ openReport ( link . path ) ;
646
650
break ;
647
651
}
648
652
} ,
649
653
} ) ,
650
654
651
- vscode . workspace . onDidChangeConfiguration ( ( event ) => {
655
+ vscode . workspace . onDidChangeConfiguration ( async ( event ) => {
652
656
for ( let s of [
653
657
"robotcode.python" ,
654
658
"robotcode.languageServer.mode" ,
@@ -662,7 +666,7 @@ export async function activateAsync(context: vscode.ExtensionContext) {
662
666
"robotcode.robot.args" ,
663
667
] ) {
664
668
if ( event . affectsConfiguration ( s ) ) {
665
- vscode . window
669
+ await vscode . window
666
670
. showWarningMessage (
667
671
'Please use the "Reload Window" action for changes in ' + s + " to take effect." ,
668
672
...[ "Reload Window" ]
0 commit comments