Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/targets/node/nodeLauncher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/

import { inject, injectable, multiInject } from 'inversify';
import { inject, injectable, multiInject, optional } from 'inversify';
import { extname, resolve } from 'path';
import * as vscode from 'vscode';
import type * as vscodeType from 'vscode';
import { IBreakpointsPredictor } from '../../adapter/breakpointPredictor';
import { IPortLeaseTracker } from '../../adapter/portLeaseTracker';
import Cdp from '../../cdp/api';
Expand All @@ -16,6 +16,7 @@ import { fixDriveLetterAndSlashes } from '../../common/pathUtils';
import { delay } from '../../common/promiseUtil';
import { absolutePathToFileUrl, urlToRegex } from '../../common/urlUtils';
import { AnyLaunchConfiguration, INodeLaunchConfiguration } from '../../configuration';
import { VSCodeApi } from '../../ioc-extras';
import { fixInspectFlags } from '../../ui/configurationUtils';
import { retryGetNodeEndpoint } from '../browser/spawn/endpoints';
import { ISourcePathResolverFactory } from '../sourcePathResolverFactory';
Expand Down Expand Up @@ -77,6 +78,7 @@ export class NodeLauncher extends NodeLauncherBase<INodeLaunchConfiguration> {
@inject(IPackageJsonProvider) private readonly packageJson: IPackageJsonProvider,
@inject(ISourcePathResolverFactory) pathResolverFactory: ISourcePathResolverFactory,
@inject(IPortLeaseTracker) portLeaseTracker: IPortLeaseTracker,
@optional() @inject(VSCodeApi) private readonly vscode?: typeof vscodeType,
) {
super(pathProvider, logger, portLeaseTracker, pathResolverFactory);
}
Expand Down Expand Up @@ -313,7 +315,11 @@ export class NodeLauncher extends NodeLauncherBase<INodeLaunchConfiguration> {
return targetProgram;
}

const resolve = readConfig(vscode.workspace, Configuration.ResolveDebugEntrypoint);
if (!this.vscode) {
return targetProgram;
}

const resolve = readConfig(this.vscode.workspace, Configuration.ResolveDebugEntrypoint);
Comment thread
lucygramley marked this conversation as resolved.
Outdated
if (!resolve) {
return targetProgram;
}
Expand Down
Loading