Skip to content

Commit

Permalink
Use node ipc for communicating with TS Server
Browse files Browse the repository at this point in the history
Fixes #85565
  • Loading branch information
mjbvz committed Jan 10, 2022
1 parent 10e0b1b commit 45c9b6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,14 @@ export class ElectronServiceProcessFactory implements TsServerProcessFactory {
tsServerPath = versionManager.currentVersion.tsServerPath;
}

// TODO: use 4.6 instead
const useIpc = version.apiVersion?.gte(API.v440);
const useIpc = version.apiVersion?.gte(API.v460);

const childProcess = child_process.fork(tsServerPath, args, {
const runtimeArgs = [...args];
if (useIpc) {
runtimeArgs.push('--useNodeIpc');
}

const childProcess = child_process.fork(tsServerPath, runtimeArgs, {
silent: true,
cwd: undefined,
env: generatePatchedEnv(process.env, tsServerPath),
Expand Down
1 change: 1 addition & 0 deletions extensions/typescript-language-features/src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default class API {
public static readonly v420 = API.fromSimpleString('4.2.0');
public static readonly v430 = API.fromSimpleString('4.3.0');
public static readonly v440 = API.fromSimpleString('4.4.0');
public static readonly v460 = API.fromSimpleString('4.6.0');

public static fromVersionString(versionString: string): API {
let version = semver.valid(versionString);
Expand Down

0 comments on commit 45c9b6f

Please sign in to comment.