Skip to content

Commit 90439a6

Browse files
authored
Don't use getCompiledProjectInfo in pickProcess (#4333)
* Skip test to let artifacts publish * Fix stupid build issue * Fix for .NET debugging * Remove export moniker * Remove changes to global.test.
1 parent a31bf0f commit 90439a6

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

Diff for: src/commands/pickFuncProcess.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { sendRequestWithTimeout, type AzExtRequestPrepareOptions } from '@micros
77
import { callWithTelemetryAndErrorHandling, parseError, UserCancelledError, type IActionContext } from '@microsoft/vscode-azext-utils';
88
import * as unixPsTree from 'ps-tree';
99
import * as vscode from 'vscode';
10-
import { hostStartTaskName, ProjectLanguage } from '../constants';
10+
import { hostStartTaskName } from '../constants';
1111
import { preDebugValidate, type IPreDebugValidateResult } from '../debug/validatePreDebug';
1212
import { ext } from '../extensionVariables';
1313
import { buildPathToWorkspaceFolderMap, getFuncPortFromTaskOrProject, isFuncHostTask, runningFuncTaskMap, stopFuncTaskIfRunning, type IRunningFuncTask } from '../funcCoreTools/funcHostTask';
@@ -17,7 +17,6 @@ import { requestUtils } from '../utils/requestUtils';
1717
import { taskUtils } from '../utils/taskUtils';
1818
import { getWindowsProcessTree, ProcessDataFlag, type IProcessInfo, type IWindowsProcessTree } from '../utils/windowsProcessTree';
1919
import { getWorkspaceSetting } from '../vsCodeConfig/settings';
20-
import { getCompiledProjectInfo } from '../workspace/listLocalProjects';
2120

2221
const funcTaskReadyEmitter = new vscode.EventEmitter<vscode.WorkspaceFolder>();
2322
export const onDotnetFuncTaskReady = funcTaskReadyEmitter.event;
@@ -82,10 +81,6 @@ export async function pickFuncProcess(context: IActionContext, debugConfig: vsco
8281
throw new UserCancelledError('preDebugValidate');
8382
}
8483

85-
const projectInfo = await getCompiledProjectInfo(context, result.workspace.uri.fsPath, ProjectLanguage.CSharp);
86-
const buildPath: string = projectInfo?.compiledProjectPath || result.workspace.uri.fsPath;
87-
await waitForPrevFuncTaskToStop(result.workspace, buildPath);
88-
8984
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
9085
const preLaunchTaskName: string | undefined = debugConfig.preLaunchTask;
9186
const tasks: vscode.Task[] = await vscode.tasks.fetchTasks();
@@ -97,6 +92,8 @@ export async function pickFuncProcess(context: IActionContext, debugConfig: vsco
9792
throw new Error(localize('noFuncTask', 'Failed to find "{0}" task.', preLaunchTaskName || hostStartTaskName));
9893
}
9994

95+
const buildPath: string = (funcTask.execution as vscode.ShellExecution)?.options?.cwd || result.workspace.uri.fsPath;
96+
await waitForPrevFuncTaskToStop(result.workspace, buildPath);
10097
const taskInfo = await startFuncTask(context, result.workspace, buildPath, funcTask);
10198
return await pickChildProcess(taskInfo);
10299
}

Diff for: src/funcCoreTools/funcHostTask.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ export function stopFuncTaskIfRunning(workspaceFolder: vscode.WorkspaceFolder |
140140
runningFuncTask = [runningFuncTaskMap.get(workspaceFolder, buildPath)];
141141
}
142142

143-
if (runningFuncTask !== undefined) {
144-
145-
143+
if (runningFuncTask !== undefined && runningFuncTask.length > 0) {
146144
for (const runningFuncTaskItem of runningFuncTask) {
147145
if (!runningFuncTaskItem) break;
148146
if (terminate) {

Diff for: src/workspace/listLocalProjects.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export async function listLocalProjects(): Promise<ListLocalProjectsResult> {
9292

9393
type CompiledProjectInfo = { compiledProjectPath: string; isIsolated: boolean };
9494

95-
export async function getCompiledProjectInfo(context: IActionContext, projectPath: string, projectLanguage: ProjectLanguage): Promise<CompiledProjectInfo | undefined> {
95+
async function getCompiledProjectInfo(context: IActionContext, projectPath: string, projectLanguage: ProjectLanguage): Promise<CompiledProjectInfo | undefined> {
9696
if (projectLanguage === ProjectLanguage.CSharp || projectLanguage === ProjectLanguage.FSharp) {
9797
const projFiles: dotnetUtils.ProjectFile[] = await dotnetUtils.getProjFiles(context, projectLanguage, projectPath);
9898
if (projFiles.length === 1) {

0 commit comments

Comments
 (0)