Skip to content

fix(vscode): respect files.exclude when finding firebase.json - #11486

Open
mtr002 wants to merge 2 commits into
mainfrom
fix/vscode-11465
Open

mtr002 wants to merge 2 commits into
mainfrom
fix/vscode-11465

Conversation

@mtr002

@mtr002 mtr002 commented Nov 11, 2026

Copy link
Copy Markdown
Member

Description

findFiles was called with an explicit **/node_modules exclude, which makes VS Code ignore files.exclude. Configs in hidden folders such as git worktrees were then picked as the project's firebase.json. Merge enabled files.exclude patterns into the exclude glob.

Partially fixes #11465

Scenarios Tested

  • Unit tests for the exclude glob builder.

Sample Commands

N/A

Description

Scenarios Tested

Sample Commands

### Description

`findFiles` was called with an explicit `**/node_modules` exclude, which makes
VS Code ignore `files.exclude`. Configs in hidden folders such as git worktrees
were then picked as the project's `firebase.json`. Merge enabled
`files.exclude` patterns into the exclude glob.

Fixes #11465

### Scenarios Tested

- Unit tests for the exclude glob builder.

### Sample Commands

N/A

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request ensures that firebase.json files in folders hidden by files.exclude (such as git worktrees) are no longer picked up as the project configuration by merging files.exclude patterns with the default **/node_modules glob. Unit tests have been added to verify this glob-building logic. Feedback on the changes includes: 1) adding a defensive check to ensure workspace.value is defined before calling .getConfiguration to prevent runtime crashes, 2) handling the case where filesExclude is null explicitly (e.g., using filesExclude ?? {}) to avoid a TypeError when calling Object.entries(), and 3) adding a test case passing null to _buildExcludeGlob to verify this null-safety.

Comment thread firebase-vscode/src/core/config.ts Resolved
Comment thread firebase-vscode/src/core/config.ts Resolved
@mtr002
mtr002 requested a review from yuchenshi November 13, 2026 00:28

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant