Skip to content

Commit

Permalink
Use TransportKind.pipe instead of TransportKind.stdio.
Browse files Browse the repository at this point in the history
Signed-off-by: Roland Grunberg <[email protected]>
  • Loading branch information
rgrunber committed Oct 23, 2023
1 parent 9e20e13 commit 502efb7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,22 @@
"default": "ask",
"markdownDescription": "Specifies whether to reload the sources of the open class files when their source jar files are changed.",
"scope": "window"
},
"java.transport": {
"type": "string",
"enum": [
"stdio",
"pipe"
],
"enumDescriptions": [
"Use standard input/output",
"Use a named pipe"
],
"default": "pipe",
"markdownDescription": "Specifies the mode of transport for communication between the client and language server.",
"scope": "window"
}

}
},
"configurationDefaults": {
Expand Down
13 changes: 12 additions & 1 deletion src/javaServerStarter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as net from 'net';
import * as os from 'os';
import * as path from 'path';
import { ExtensionContext, version, workspace } from 'vscode';
import { Executable, ExecutableOptions, StreamInfo } from 'vscode-languageclient/node';
import { Executable, ExecutableOptions, StreamInfo, TransportKind } from 'vscode-languageclient/node';
import { logger } from './log';
import { addLombokParam, isLombokSupportEnabled } from './lombokSupport';
import { RequirementsData } from './requirements';
Expand Down Expand Up @@ -48,6 +48,17 @@ export function prepareExecutable(requirements: RequirementsData, workspacePath,
executable.options = options;
executable.command = path.resolve(`${requirements.tooling_jre}/bin/java`);
executable.args = prepareParams(requirements, workspacePath, context, isSyntaxServer);
const transportKind = getJavaConfiguration().get('transport');
switch (transportKind) {
case 'pipe':
executable.transport = TransportKind.pipe;
break;
case 'stdio':
executable.transport = TransportKind.stdio;
break;
default:
break;
}
logger.info(`Starting Java server with: ${executable.command} ${executable.args.join(' ')}`);
return executable;
}
Expand Down

0 comments on commit 502efb7

Please sign in to comment.