Skip to content

Commit f50ee35

Browse files
committed
Add a setting
1 parent 5ae36d6 commit f50ee35

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,11 @@
13731373
"description": "%azureFunctions.validateFuncCoreTools%",
13741374
"default": true
13751375
},
1376+
"azureFunctions.forceEmulatorValidation": {
1377+
"type": "boolean",
1378+
"description": "%azureFunctions.forceEmulatorValidation%",
1379+
"default": false
1380+
},
13761381
"azureFunctions.requestTimeout": {
13771382
"type": "number",
13781383
"description": "%azureFunctions.requestTimeout%",

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
"azureFunctions.toggleAppSettingVisibility": "Toggle App Setting Visibility.",
112112
"azureFunctions.uninstallFuncCoreTools": "Uninstall Azure Functions Core Tools",
113113
"azureFunctions.validateFuncCoreTools": "Validate the Azure Functions Core Tools is installed before debugging.",
114+
"azureFunctions.forceEmulatorValidation": "Force the extension to validate and set up emulator connections before debugging, even when a pre-launch task referencing an emulator is detected.",
114115
"azureFunctions.viewCommitInGitHub": "View Commit in GitHub",
115116
"azureFunctions.viewDeploymentLogs": "View Deployment Logs",
116117
"azureFunctions.viewProperties": "View Properties",

src/debug/validatePreDebug.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ export async function preDebugValidate(actionContext: IActionContext, debugConfi
4646
const preLaunchTaskName: string | undefined = debugConfig.preLaunchTask;
4747
const preLaunchTaskChain: string[] = preLaunchTaskName ? getPreLaunchTaskChain(getTasks(workspace), preLaunchTaskName) : [];
4848
const hasEmulatorTask: boolean = preLaunchTaskChain.some(label => emulatorTaskRegExp.test(label));
49+
const forceEmulatorValidation: boolean = !!getWorkspaceSetting<boolean>('forceEmulatorValidation');
50+
const skipEmulatorValidation: boolean = hasEmulatorTask && !forceEmulatorValidation;
4951
context.telemetry.properties.hasEmulatorTask = String(hasEmulatorTask);
52+
context.telemetry.properties.forceEmulatorValidation = String(forceEmulatorValidation);
5053

5154
try {
5255
context.telemetry.properties.lastValidateStep = 'funcInstalled';
@@ -72,7 +75,7 @@ export async function preDebugValidate(actionContext: IActionContext, debugConfi
7275
context.telemetry.properties.lastValidateStep = 'workerRuntime';
7376
await validateWorkerRuntime(context, projectLanguage, context.projectPath);
7477

75-
if (!hasEmulatorTask) {
78+
if (!skipEmulatorValidation) {
7679
switch (durableStorageType) {
7780
case DurableBackend.DTS:
7881
context.telemetry.properties.lastValidateStep = 'dtsConnection';
@@ -94,7 +97,7 @@ export async function preDebugValidate(actionContext: IActionContext, debugConfi
9497
await validateAzureWebJobsStorage(context, context.projectPath);
9598

9699
context.telemetry.properties.lastValidateStep = 'emulatorRunning';
97-
shouldContinue = hasEmulatorTask || await validateEmulatorIsRunning(context, context.projectPath);
100+
shouldContinue = await validateEmulatorIsRunning(context, context.projectPath);
98101
}
99102
}
100103
}

0 commit comments

Comments
 (0)