Skip to content

Commit

Permalink
Ensure node-based debug adapter spawn same node as Theia
Browse files Browse the repository at this point in the history
Signed-off-by: Eyal Barlev <eyal.barlev@sap.com>
  • Loading branch information
perspectivus1 committed Jun 17, 2019
1 parent 6b8e776 commit 5c7fbc8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/debug/src/node/debug-adapter-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ import {
CommunicationProvider,
DebugAdapterSession,
DebugAdapterSessionFactory,
DebugAdapterFactory
DebugAdapterFactory,
DebugAdapterSpawnExecutable
} from '../common/debug-model';
import { DebugAdapterSessionImpl } from './debug-adapter-session';

Expand Down Expand Up @@ -66,6 +67,12 @@ export class LaunchBasedDebugAdapterFactory implements DebugAdapterFactory {
const isForkOptions = (forkOptions: RawForkOptions | any): forkOptions is RawForkOptions =>
!!forkOptions && !!forkOptions.modulePath;

if (!isForkOptions(executable)) {
if ((executable as DebugAdapterSpawnExecutable).command === 'node') {
(executable as DebugAdapterSpawnExecutable).command = process.execPath;
}
}

const processOptions: RawProcessOptions | RawForkOptions = { ...executable };
const options = { stdio: ['pipe', 'pipe', 2] };

Expand Down

0 comments on commit 5c7fbc8

Please sign in to comment.