@@ -4,6 +4,7 @@ import * as net from 'net';
4
4
import * as glob from 'glob' ;
5
5
import { StreamInfo , Executable , ExecutableOptions } from 'vscode-languageclient' ;
6
6
import { RequirementsData } from './requirements' ;
7
+ import { getJavaEncoding } from './settings' ;
7
8
8
9
declare var v8debug ;
9
10
const DEBUG = ( typeof v8debug === 'object' ) || startedInDebugMode ( ) ;
@@ -50,6 +51,7 @@ function prepareParams(requirements: RequirementsData, javaConfiguration, worksp
50
51
'--add-opens' ,
51
52
'java.base/java.lang=ALL-UNNAMED' ) ;
52
53
}
54
+
53
55
params . push ( '-Declipse.application=org.eclipse.jdt.ls.core.id1' ,
54
56
'-Dosgi.bundles.defaultStartLevel=4' ,
55
57
'-Declipse.product=org.eclipse.jdt.ls.core.product' ) ;
@@ -58,6 +60,11 @@ function prepareParams(requirements: RequirementsData, javaConfiguration, worksp
58
60
}
59
61
60
62
let vmargs = javaConfiguration . get ( 'jdt.ls.vmargs' , '' ) ;
63
+ const encodingKey = '-Dfile.encoding=' ;
64
+ if ( vmargs . indexOf ( encodingKey ) < 0 ) {
65
+ params . push ( encodingKey + getJavaEncoding ( ) ) ;
66
+ }
67
+
61
68
parseVMargs ( params , vmargs ) ;
62
69
let server_home : string = path . resolve ( __dirname , '../server' ) ;
63
70
let launchersFound : Array < string > = glob . sync ( '**/plugins/org.eclipse.equinox.launcher_*.jar' , { cwd : server_home } ) ;
0 commit comments