@@ -7,7 +7,7 @@ import { sendRequestWithTimeout, type AzExtRequestPrepareOptions } from '@micros
7
7
import { callWithTelemetryAndErrorHandling , parseError , UserCancelledError , type IActionContext } from '@microsoft/vscode-azext-utils' ;
8
8
import * as unixPsTree from 'ps-tree' ;
9
9
import * as vscode from 'vscode' ;
10
- import { hostStartTaskName , ProjectLanguage } from '../constants' ;
10
+ import { hostStartTaskName } from '../constants' ;
11
11
import { preDebugValidate , type IPreDebugValidateResult } from '../debug/validatePreDebug' ;
12
12
import { ext } from '../extensionVariables' ;
13
13
import { buildPathToWorkspaceFolderMap , getFuncPortFromTaskOrProject , isFuncHostTask , runningFuncTaskMap , stopFuncTaskIfRunning , type IRunningFuncTask } from '../funcCoreTools/funcHostTask' ;
@@ -17,7 +17,6 @@ import { requestUtils } from '../utils/requestUtils';
17
17
import { taskUtils } from '../utils/taskUtils' ;
18
18
import { getWindowsProcessTree , ProcessDataFlag , type IProcessInfo , type IWindowsProcessTree } from '../utils/windowsProcessTree' ;
19
19
import { getWorkspaceSetting } from '../vsCodeConfig/settings' ;
20
- import { getCompiledProjectInfo } from '../workspace/listLocalProjects' ;
21
20
22
21
const funcTaskReadyEmitter = new vscode . EventEmitter < vscode . WorkspaceFolder > ( ) ;
23
22
export const onDotnetFuncTaskReady = funcTaskReadyEmitter . event ;
@@ -82,10 +81,6 @@ export async function pickFuncProcess(context: IActionContext, debugConfig: vsco
82
81
throw new UserCancelledError ( 'preDebugValidate' ) ;
83
82
}
84
83
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
-
89
84
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
90
85
const preLaunchTaskName : string | undefined = debugConfig . preLaunchTask ;
91
86
const tasks : vscode . Task [ ] = await vscode . tasks . fetchTasks ( ) ;
@@ -97,6 +92,8 @@ export async function pickFuncProcess(context: IActionContext, debugConfig: vsco
97
92
throw new Error ( localize ( 'noFuncTask' , 'Failed to find "{0}" task.' , preLaunchTaskName || hostStartTaskName ) ) ;
98
93
}
99
94
95
+ const buildPath : string = ( funcTask . execution as vscode . ShellExecution ) ?. options ?. cwd || result . workspace . uri . fsPath ;
96
+ await waitForPrevFuncTaskToStop ( result . workspace , buildPath ) ;
100
97
const taskInfo = await startFuncTask ( context , result . workspace , buildPath , funcTask ) ;
101
98
return await pickChildProcess ( taskInfo ) ;
102
99
}
0 commit comments