Skip to content

fix(vscode): respect manual LSP path settings when auto-validation is disabled#9258

Open
wsilveiranz wants to merge 2 commits into
Azure:mainfrom
wsilveiranz:fix/lsp-manual-path-settings
Open

fix(vscode): respect manual LSP path settings when auto-validation is disabled#9258
wsilveiranz wants to merge 2 commits into
Azure:mainfrom
wsilveiranz:fix/lsp-manual-path-settings

Conversation

@wsilveiranz

@wsilveiranz wsilveiranz commented Jun 8, 2026

Copy link
Copy Markdown
Member

Commit Type

  • feature - New functionality
  • fix - Bug fix
  • refactor - Code restructuring without behavior change
  • perf - Performance improvement
  • docs - Documentation update
  • test - Test-related changes
  • chore - Maintenance/tooling

Risk Level

  • Low - Minor changes, limited scope
  • Medium - Moderate changes, some user impact
  • High - Major changes, significant user/system impact

What & Why

Fixes three issues that prevent the VS Code extension from working correctly when autoRuntimeDependenciesValidationAndInstallation is disabled (e.g., for security-restricted environments where the extension cannot download/install dependencies automatically).

1. languageServerDLLPath and languageServerNupkgPath settings ignored

These settings are declared in package.json but were never consumed by getSDKPaths(). The function always constructed paths from autoRuntimeDependenciesPath + hardcoded subfolder patterns, regardless of the auto-validation setting.

Fix: When auto-validation is OFF, getSDKPaths() reads the explicit user-configured paths directly.

2. Regression: LSP server gated on custom code project detection

Commit 0d9fafd74 introduced a gate that silently prevented the LSP server from starting unless a C# custom code project existed alongside the Logic App. The original design (298310ab4) had no such requirement.

Fix: Removed the gate so the language server starts unconditionally (as originally designed).

3. installBinaries() overwrites user-configured binary paths

On every activation when auto-validation is OFF, installBinaries() unconditionally reset dotnetBinaryPath, nodeJsBinaryPath, and funcCoreToolsBinaryPath to bare defaults, clobbering any user-configured paths.

Fix: Only sets defaults when the settings are not already configured.

Impact of Change

  • Users: Users with autoRuntimeDependenciesValidationAndInstallation disabled can now properly configure and use explicit LSP DLL/NUPKG paths and retain their custom binary paths across extension activations.
  • Developers: Language server startup no longer depends on custom code project detection. This simplifies the activation flow.
  • System: Reduces unintended overwrites of configured dependency paths during activation. No new APIs or dependencies.

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in: VS Code with autoRuntimeDependenciesValidationAndInstallation disabled and explicit path settings configured

Contributors

@wsilveiranz

Screenshots/Videos

N/A - No UI changes.

… disabled

Three issues fixed:

1. languageServerDLLPath and languageServerNupkgPath settings were declared in
   package.json but never consumed by getSDKPaths(). Now when
   autoRuntimeDependenciesValidationAndInstallation is OFF, these settings are
   read directly instead of constructing paths from autoRuntimeDependenciesPath.

2. Regression from 0d9fafd: a tryGetLogicAppCustomCodeFunctionsProjects gate
   was added that silently prevented the LSP server from starting unless a C#
   custom code project existed alongside the Logic App. The original design
   (298310a) had no such gate. Removed.

3. installBinaries() unconditionally overwrote dotnetBinaryPath,
   nodeJsBinaryPath, and funcCoreToolsBinaryPath with system defaults on every
   activation when auto-validation was OFF, clobbering user-configured paths.
   Now only sets defaults if the settings are not already configured.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 8, 2026 03:23
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

PR Title

  • Current: fix(vscode): respect manual LSP path settings when auto-validation is disabled
  • Issue: None — the title is specific, scoped, and clearly describes the behavior change.
  • Recommendation: No change needed.

Commit Type

  • Properly selected (fix).
  • Only one option is checked, which is correct.

Risk Level

  • The selected label/body risk is Medium, and that matches the PR label risk:medium.
  • Advised risk level: medium.

What & Why

  • Current: Clear explanation of the three fixes and why they matter, including the manual dependency scenario.
  • Issue: None.
  • Recommendation: No change needed.

Impact of Change

  • The impact section is present and gives a solid breakdown of users, developers, and system effects.
  • Recommendation:
    • Users: Good as written.
    • Developers: Good as written.
    • System: Good as written.

Test Plan

  • Unit tests are present in the diff, which satisfies the test-plan requirement.
  • Manual testing is also documented clearly.
  • No E2E tests are required because unit tests already exist.

Contributors

  • Contributors are listed.
  • No issues found.

Screenshots/Videos

  • Marked appropriately as N/A since there are no UI changes.

Summary Table

Section Status Recommendation
Title No change needed
Commit Type No change needed
Risk Level No change needed
What & Why No change needed
Impact of Change No change needed
Test Plan No change needed
Contributors No change needed
Screenshots/Videos No change needed

This PR passes review for title and body compliance.


Last updated: Mon, 08 Jun 2026 03:32:48 GMT

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the VS Code Logic Apps extension’s Language Server Protocol (LSP) startup behavior in environments where autoRuntimeDependenciesValidationAndInstallation is disabled, ensuring explicitly configured paths are honored and the language server isn’t incorrectly gated.

Changes:

  • Added constants for languageServerDLLPath / languageServerNupkgPath configuration keys.
  • Updated LSP startup to (a) no longer require a linked custom code project and (b) read explicit LSP DLL/nupkg paths when auto-validation is disabled.
  • Updated binaries installation logic to avoid overwriting user-configured binary paths when auto-validation is disabled, with corresponding test updates.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/vs-code-designer/src/constants.ts Adds constants for manual LSP path settings keys.
apps/vs-code-designer/src/app/utils/binaries.ts Avoids overwriting existing binary path settings when auto-validation is off.
apps/vs-code-designer/src/app/utils/test/binaries.test.ts Updates tests to cover “don’t overwrite” + “set defaults only when unset” behavior.
apps/vs-code-designer/src/app/languageServer/languageServer.ts Removes custom-code gating; supports manual LSP path settings when auto-validation is off.
apps/vs-code-designer/src/app/languageServer/test/languageServer.test.ts Removes obsolete gating test; adds manual-mode path behavior tests.

Comment on lines +185 to +193
if (lspServerPath && !(await fse.pathExists(lspServerPath))) {
window.showWarningMessage(`Language server DLL not found at configured path: ${lspServerPath}`);
return { lspServerPath: undefined, sdkNupkgPath };
}

if (sdkNupkgPath && !(await fse.pathExists(sdkNupkgPath))) {
window.showWarningMessage(`Language server SDK nupkg not found at configured path: ${sdkNupkgPath}`);
return { lspServerPath, sdkNupkgPath: undefined };
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — removed the duplicate warnings from getSDKPaths(). Now only start() shows the appropriate message when paths are undefined, avoiding duplicate popups.

Comment on lines +578 to 582
it('should not overwrite existing paths in devContainer workspace', async () => {
(getGlobalSetting as Mock).mockReturnValue(true);
const devContainerModule = await import('../devContainerUtils');
vi.mocked(devContainerModule.isDevContainerWorkspace).mockResolvedValue(true);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — updated the mock to return realistic path strings (/custom/path/dotnet, /custom/path/node, /custom/path/func) instead of a boolean, making the test more representative of actual usage.

@wsilveiranz wsilveiranz added the risk:medium Medium risk change with potential impact label Jun 8, 2026
…ic test values

- Remove path-not-found warnings from getSDKPaths() to avoid duplicate popups
  (start() already shows appropriate warnings when paths are undefined)
- Use realistic path strings instead of boolean in binaries test mock

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:medium Medium risk change with potential impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants