Skip to content

Commit 431cd66

Browse files
author
Pengcheng Xu
authored
[Code] Use data dir as config dir (#32609)
1 parent bd94531 commit 431cd66

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

x-pack/plugins/code/server/lsp/java_launcher.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ export class JavaLauncher implements ILanguageServerLauncher {
9292
return path.resolve(installationPath, JDKFound[0]);
9393
}
9494

95-
let config = 'config_mac';
9695
let bundledJavaHome = `${findJDK('osx')}/Contents/Home`;
9796
let javaPath = 'java';
9897
let javaHomePath = '';
@@ -102,11 +101,9 @@ export class JavaLauncher implements ILanguageServerLauncher {
102101
break;
103102
case 'win32':
104103
bundledJavaHome = `${findJDK('windows')}`;
105-
config = 'config_win';
106104
break;
107105
case 'linux':
108106
bundledJavaHome = `${findJDK('linux')}`;
109-
config = 'config_linux';
110107
break;
111108
default:
112109
log.error('Unable to find platform for this os');
@@ -139,7 +136,7 @@ export class JavaLauncher implements ILanguageServerLauncher {
139136
'-jar',
140137
path.resolve(installationPath, launchersFound[0]),
141138
'-configuration',
142-
path.resolve(installationPath, './repository', config),
139+
this.options.jdtConfigPath,
143140
'-data',
144141
this.options.jdtWorkspacePath,
145142
],

x-pack/plugins/code/server/server_options.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export class ServerOptions {
2121

2222
public readonly jdtWorkspacePath = resolve(this.config.get('path.data'), 'code/jdt_ws');
2323

24+
public readonly jdtConfigPath = resolve(this.config.get('path.data'), 'code/jdt_config');
25+
2426
public readonly updateFrequencyMs: number = this.options.updateFreqencyMs;
2527

2628
public readonly indexFrequencyMs: number = this.options.indexFrequencyMs;

0 commit comments

Comments
 (0)