Skip to content

FIx: show error message when running npm install without open workspace#317657

Open
ot7Deity wants to merge 2 commits into
microsoft:mainfrom
ot7Deity:main
Open

FIx: show error message when running npm install without open workspace#317657
ot7Deity wants to merge 2 commits into
microsoft:mainfrom
ot7Deity:main

Conversation

@ot7Deity
Copy link
Copy Markdown

Description
Fixes a silent failure where running _runNpmInstall() did nothing if a user did not have a folder open in the workspace. Added a clear error message utilizing vscode.window.showErrorMessage to provide immediate feedback to the user.

How to Test

  1. Close all open folders/workspaces in VS Code.
  2. Trigger the vscode-extras.runNpmInstall command (via the status bar or command palette).
  3. Verify that a native VS Code error notification appears stating: "npm install requires an open workspace folder".
  4. Open a workspace folder, run the command again, and verify that the terminal spawns and runs the install script normally.

Copilot AI review requested due to automatic review settings May 20, 2026 23:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a silent no-op in the vscode-extras selfhost extension by surfacing an explicit user-facing error when vscode-extras.runNpmInstall is invoked without any open workspace folder, improving feedback in the VS Code workbench.

Changes:

  • Show an error notification and early-return when _runNpmInstall() is executed without an open workspace folder.

Comment thread .vscode/extensions/vscode-extras/src/npmUpToDateFeature.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants