fix(vscode): Debugging regressions#9289
Open
lambrianmsft wants to merge 16 commits into
Open
Conversation
…g ordering, LSP, project types, workflow creation Issue 1: Windows binary .exe resolution - binariesExist() now tries .exe variant on Windows before declaring binary missing - setNodeJsCommand() uses resolveNodeJsCommand() to find node.exe (mirrors func pattern) - Prevents 429MB+ re-download on every VS Code startup for Windows users Issue 2: F5 debug file locking on rapid stop/start - Moved waitForPrevFuncTaskToStop() BEFORE build/publish steps in pickFuncProcessInternal - Made stopDesignTimeApi() async, awaiting taskkill completion on Windows - Prevents GenerateFunctionMetadata IOException on obj/Debug/net8/WorkerExtensions Issue 3: LSP extraction EPERM + defensive path guards - formatLockedFileError() now recognizes EPERM alongside EBUSY - installLSPSDK() retries up to 3 times with 2s delay on locked file errors - getAzureConnectorDetailsForLocalProject() validates projectPath before use Issue 4: Codeful / custom code project type separation - pickFuncProcessInternal guards build paths by project type (isCodefulProject) - Removed invalidateCodefulSdkCacheIfNeeded from custom code build path - Codeful projects only run publishCodefulProject, custom code only runs tryBuild Issue 5: Create workflow crash without .code-workspace - createWorkflow falls back to vscode.workspace.workspaceFolders when getWorkspaceRoot returns undefined - Shows user-friendly error instead of path.basename(undefined) crash Regression commits identified: - 0d9fafd (Node 24 compat Azure#9246) introduced binariesExist binary path check without .exe - 298310a (Codeful Public Preview Azure#9142) introduced Issues 2-5 - 4430048 (Azure#9155) contributed to Issue 1 via setNodeJsCommand without .exe Fixes Azure#9271, Azure#9248, Azure#9244, Azure#9237 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Repair managed FuncCoreTools executable permissions for cached installs and make VS Code E2E runtime readiness assert executable nested binaries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
✅ What & Why
✅ Impact of Change
✅ Test Plan
✅ Contributors
✅ Screenshots/Videos
Summary Table
This PR passes review for title/body compliance. The advised risk level is medium, which matches the submitter’s selection.Last updated: Sat, 27 Jun 2026 22:57:28 GMT |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR targets VS Code extension debugging/startup regressions by improving process shutdown sequencing and hardening auto-downloaded runtime dependency detection/permissions, so repeated debug sessions work reliably and dependencies aren’t unnecessarily re-downloaded.
Changes:
- Make design-time API shutdown awaitable (including Windows
taskkill) to avoid file-lock/cleanup races that break subsequent debug runs. - Improve runtime dependency validation/resolution (FuncCoreTools/node/dotnet) including execute-permission repair and Windows
.exepath fallback. - Expand E2E/unit coverage around the updated dependency readiness and workflow/project discovery behaviors.
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/vs-code-designer/src/test/ui/runHelpers.ts | Add FuncCoreTools permission diagnostics for runtime readiness troubleshooting. |
| apps/vs-code-designer/src/test/ui/run-e2e.js | Harden E2E dependency readiness by checking/repairing executable permissions (incl. gozip). |
| apps/vs-code-designer/src/test/ui/designerHelpers.ts | Validate both func + gozip executability and prefer func candidates when selecting a path. |
| apps/vs-code-designer/src/main.ts | Await async shutdown of all design-time APIs during extension deactivation. |
| apps/vs-code-designer/src/app/utils/nodeJs/nodeJsVersion.ts | Improve Windows Node binary resolution by trying .exe variants. |
| apps/vs-code-designer/src/app/utils/nodeJs/test/nodeJsVersion.test.ts | Add unit tests for Windows node vs node.exe resolution behavior. |
| apps/vs-code-designer/src/app/utils/languageServerProtocol.ts | Retry removal on locked-file errors (EBUSY/EPERM) and export locked-file formatting. |
| apps/vs-code-designer/src/app/utils/funcCoreTools/funcVersion.ts | Add FuncCoreTools permission repair/validation and ensure managed binaries are executable. |
| apps/vs-code-designer/src/app/utils/funcCoreTools/test/funcVersion.test.ts | Add tests for permission repair and managed FuncCoreTools executability validation. |
| apps/vs-code-designer/src/app/utils/devContainerUtils.ts | Add sync devcontainer detection for use in sync dependency checks. |
| apps/vs-code-designer/src/app/utils/codeless/startDesignTimeApi.ts | Make stop APIs async and await Windows taskkill completion to reduce lock races. |
| apps/vs-code-designer/src/app/utils/codeless/common.ts | Guard against missing projectPath in Azure connector details logic with telemetry. |
| apps/vs-code-designer/src/app/utils/codeless/test/startDesignTimeApi.test.ts | Add coverage for awaiting Windows taskkill callbacks before resolving stop. |
| apps/vs-code-designer/src/app/utils/codeless/test/common.test.ts | Add test for undefined projectPath handling. |
| apps/vs-code-designer/src/app/utils/binaries.ts | Improve install/validate behavior: permission repair, devcontainer sync checks, .exe fallback, and cleaner GitHub fallback paths. |
| apps/vs-code-designer/src/app/utils/test/languageServerProtocol.test.ts | Add tests for EPERM detection and retry behavior during LSP install. |
| apps/vs-code-designer/src/app/utils/test/binaries.test.ts | Add tests for Windows .exe fallback, sync existence checks, and GitHub lookup fallback telemetry. |
| apps/vs-code-designer/src/app/commands/pickFuncProcess.ts | Stop prior func task before build/publish and split codeful vs custom-code build paths. |
| apps/vs-code-designer/src/app/commands/nodeJs/validateNodeJsIsLatest.ts | Fix async dependency existence check by awaiting binariesExist. |
| apps/vs-code-designer/src/app/commands/nodeJs/test/validateNodeJsIsLatest.test.ts | Add tests ensuring GitHub latest checks only happen when appropriate. |
| apps/vs-code-designer/src/app/commands/initProjectForVSCode/initScriptProjectStep.ts | Use sync binaries existence to avoid async misuse during task creation. |
| apps/vs-code-designer/src/app/commands/initProjectForVSCode/initProjectStep.ts | Use sync binaries existence to avoid async misuse during task creation. |
| apps/vs-code-designer/src/app/commands/initProjectForVSCode/initDotnetProjectStep.ts | Use sync binaries existence to avoid async misuse during task creation. |
| apps/vs-code-designer/src/app/commands/funcCoreTools/validateFuncCoreToolsIsLatest.ts | Await design-time API shutdown before updating func tools. |
| apps/vs-code-designer/src/app/commands/funcCoreTools/validateFuncCoreToolsInstalled.ts | Validate managed FuncCoreTools nested executability before/after invoking func. |
| apps/vs-code-designer/src/app/commands/funcCoreTools/test/validateFuncCoreToolsInstalled.test.ts | Add coverage for managed nested executability gating behavior. |
| apps/vs-code-designer/src/app/commands/dotnet/validateDotNetIsLatest.ts | Fix async dependency existence check by awaiting binariesExist. |
| apps/vs-code-designer/src/app/commands/dotnet/test/validateDotNetIsLatest.test.ts | Add tests ensuring latest checks are gated by binaries existence. |
| apps/vs-code-designer/src/app/commands/createWorkflow/createWorkflow.ts | Improve project root discovery across multi-folder workspaces; throw user-friendly error when absent. |
| apps/vs-code-designer/src/app/commands/createWorkflow/createLogicAppWorkflow.ts | Allow workflow creation in folder-opened projects (no workspace file required). |
| apps/vs-code-designer/src/app/commands/createWorkflow/test/createWorkflow.test.ts | Add tests for multi-folder fallback and no-project error behavior. |
| apps/vs-code-designer/src/app/commands/createWorkflow/test/createLogicAppWorkflow.test.ts | Update tests to reflect folder-opened workflow creation support. |
| apps/vs-code-designer/src/app/commands/createProject/createCustomCodeProjectSteps/initCustomCodeScriptProjectStep.ts | Use sync binaries existence for task env selection. |
| apps/vs-code-designer/src/app/commands/createProject/createCustomCodeProjectSteps/initCustomCodeProjectStep.ts | Use sync binaries existence for task env selection. |
| apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/CreateLogicAppVSCodeContents.ts | Use sync binaries existence when generating tasks for new codeful projects. |
| apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/test/CreateLogicAppVSCodeContents.test.ts | Update mocks for new sync binaries existence helper. |
| apps/vs-code-designer/src/app/commands/buildCustomCodeFunctionsProject.ts | Remove codeful SDK cache invalidation from build path. |
| apps/vs-code-designer/src/app/commands/test/pickFuncProcess.test.ts | Add tests for codeful/custom-code branching and waiting for prior func task to stop. |
Comment on lines
+661
to
+667
| function execTaskkill(pid: number): Promise<void> { | ||
| return new Promise((resolve) => { | ||
| cp.exec(`taskkill /pid ${pid} /t /f`, () => { | ||
| resolve(); | ||
| }); | ||
| }); | ||
| } |
Comment on lines
+93
to
+95
| const candidates = ext.nodeJsCliPath.toLowerCase().endsWith('.exe') | ||
| ? [ext.nodeJsCliPath, `${ext.nodeJsCliPath}.exe`] | ||
| : [`${ext.nodeJsCliPath}.exe`, ext.nodeJsCliPath]; |
Normalize Windows-style project paths before deriving the Logic App name so Linux CI and non-workspace create workflow paths agree. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cover isDevContainerWorkspaceSync so changed-file coverage stays above the PR gate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Allow hyphenated workflow names in the create workspace webview validation path, expand validator/message coverage, and harden LSP SDK extraction against transient Windows EPERM locks. Add a manual Windows ExTester repro mode for real LSP extraction ACL failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the consolidated hyphenated workflow-name coverage as a validation assertion without requiring the shared pre-creation form to have every required field populated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make the outdated NodeJS prompt nonblocking, refresh the managed Node command after user-selected updates, and add output-channel diagnostics for local/feed/latest versions and warning decisions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…root workspaces Previously, createWorkflow always scanned workspace folders in order and picked the first Logic App project found, ignoring the explorer context menu URI. In multi-root workspaces this caused workflows to be placed in the wrong project. Now the command accepts the URI from the explorer context menu, resolves the containing workspace folder via vscode.workspace.getWorkspaceFolder, and targets that specific project. The panel name also includes the project name for per-project isolation of cached webview panels. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When creating a workflow in a multi-root workspace, the webview now shows a Project dropdown allowing the user to select which Logic App project to create the workflow in. The dropdown is pre-selected when right-click context provides the project, and shows a 'Select Project' placeholder when invoked from the command palette. - Collect all available Logic App projects and send to webview - Add Project dropdown with Fluent UI in createWorkflowSetup - Require project selection before allowing workflow creation - Resolve project from webview selection in createHandler - Update unit tests for new architecture Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Preserve availableProjects in resetState when preserveLogicAppData=true to fix race condition that wiped dropdown data on component mount - Simplify canProceed validation for createWorkflow flow (pre-existing project names don't need regex/collision checks) - Add suppressPrompt=true to all activation-time callers of tryGetLogicAppProjectRoot to prevent unwanted project selection dialog - Update E2E test fillCreateWorkflowWebview to verify Project dropdown visibility and pre-selection Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…startup prompts
- Remove resetState call from CreateWorkflow component. Each webview
panel is fresh — resetting state races with initializeWorkspace and
wipes availableProjects before the dropdown can render.
- Add skipPromptOnMultipleFolders=true to verifyLocalConnectionKeys
which runs on activation and was showing a project selection quickpick.
- Add suppressPrompt=true to tryGetLogicAppProjectRoot calls in
connectionKeys.ts, tasks.ts, and funcHostTask.ts.
- Wrap collectAvailableProjects in try/catch with proper error message
formatting to prevent opaque '{}' error display.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
17e31e1 to
ab5810a
Compare
Root cause: VS Code's internal getWorkspaceFolder throws new Error('')
(empty message) which parseError serializes as '{}' via JSON.stringify.
Fixes:
- Suppress '{}' error notifications in global error handler (still logged)
- Wrap getWorkspaceFolder call in try/catch with duck-type URI check
- Specify explicit localResourceRoots in webview panel to avoid VS Code
internally resolving workspace folders during panel creation
- Add diagnostic logging (callbackId + full stack) to trace the error source
The Create Workflow webview will now always open regardless of whether
getWorkspaceFolder throws internally.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ab5810a to
200f149
Compare
Prevent users from creating a workflow with a name that already exists in the selected Logic App project. Changes: - Extension: collectAvailableProjects now gathers existing workflow names via getWorkflowsInLocalProject for each project - State: AvailableProject interface includes existingWorkflows string[] - Validation: validateWorkflowName checks for case-insensitive collision against existing workflows and shows a warning message - canProceed: returns false when workflow name collides, disabling Next - UI: WorkflowTypeStep shows error validation message under the field Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Type
Risk Level
What & Why
Fixing debugging and start up regressions that users are experiencing. Debugging only happens once consistently and startup seems to download all the dependencies all the time.
Impact of Change
Test Plan
Contributors
Screenshots/Videos