Skip to content

Broaden NPM detection for VS Code extensions#1801

Open
pjcollins wants to merge 1 commit intomicrosoft:mainfrom
pjcollins:enableNpmVSCodeExtensionDetection
Open

Broaden NPM detection for VS Code extensions#1801
pjcollins wants to merge 1 commit intomicrosoft:mainfrom
pjcollins:enableNpmVSCodeExtensionDetection

Conversation

@pjcollins
Copy link
Copy Markdown
Member

Context: #1348
Context: microsoft/vscode#295040

Commit a209393 added logic to ignore NPM dependencies declared in a
package.json file if it belonged to a VS Code extension. This was done
to ignore warnings for out of date package versions that are built
directly into VS Code, however it also limits detection capabilities for
all VS Code extension files.

A change was made to bump the built in package versions in VS Code in
commit microsoft/vscode@e987c52
which should allow us to revert this change and restore broader NPM
detection for VS Code extensions.

Context: microsoft#1348
Context: microsoft/vscode#295040

Commit a209393 added logic to ignore NPM dependencies declared in a
package.json file if it belonged to a VS Code extension. This was done
to ignore warnings for out of date package versions that are built
directly into VS Code, however it also limits detection capabilities for
all VS Code extension files.

A change was made to bump the built in package versions in VS Code in
commit microsoft/vscode@e987c52
which should allow us to revert this change and restore broader NPM
detection for VS Code extensions.
@pjcollins pjcollins requested a review from a team as a code owner April 27, 2026 22:18
@pjcollins
Copy link
Copy Markdown
Member Author

FYI @rzhao271 and @dtivel

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

This PR restores full npm package.json detection for VS Code extensions by removing the special-case logic that previously skipped packages declaring a vscode engine, aligning behavior with the updated VS Code built-in package versions.

Changes:

  • Remove VS Code extension skip logic from NpmComponentDetector (no longer ignores engines.vscode).
  • Bump NpmComponentDetector version to reflect the behavior change.
  • Update unit tests to assert that VS Code engine packages are detected (including the malformed engines-as-array case).

Reviewed changes

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

File Description
src/Microsoft.ComponentDetection.Detectors/npm/NpmComponentDetector.cs Removes VS Code engine-based skip behavior and increments detector version.
test/Microsoft.ComponentDetection.Detectors.Tests/NpmDetectorTests.cs Updates tests to expect detection for packages with engines.vscode (object and array cases).

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