Repository navigation
Avoid recursive LSP watches on macOS home-directory roots - #65393
Open
Jake Bailey (jakebailey) with Copilot wants to merge 4 commits into
Open
Jake Bailey (jakebailey) with Copilot wants to merge 4 commits into
Jake Bailey (jakebailey) with Copilot wants to merge 4 commits into
Conversation
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix LSP recursive watch on
Avoid recursive LSP watches on macOS home-directory roots
Nov 8, 2026
/Users without package.json
Jake Bailey (jakebailey)
approved these changes
Nov 8, 2026
Jake Bailey (jakebailey)
left a comment
Member
There was a problem hiding this comment.
Yes, exactly this
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The macOS path check still permits a recursive /users watch on case-insensitive filesystems because it compares original casing, and the existing tests do not cover lowercase paths.
1 open issue
What changed in this PR
This PR addresses #65387 by extending the language server’s watch-root safeguards to macOS home directories, preventing overly broad recursive watches.
Changes:
- Group
/Users/<user>as one logical path component, matching existing home-directory safeguards. - Add regression coverage for excluding home roots while preserving project and sibling-directory watches.
| File | Description |
|---|---|
tsc/internal/project/watch.go |
Adds macOS home-directory grouping to watch-root selection. |
tsc/internal/project/watch_test.go |
Tests path grouping and watcher filtering under both case-sensitivity modes. |
Review effort: Balanced
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Jake Bailey (jakebailey)
approved these changes
Nov 8, 2026
Jake Bailey (jakebailey)
requested review from
Andrew Branch (andrewbranch) and
John Favret (johnfav03)
November 8, 2026 16:48
This branch has not been deployed
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.

Fixes #65387
Analysis
For projects without a
package.json, ancestor lookup paths can produce a recursive watch on/Users. Watch-root grouping protects Windows and Linux home directories but omits macOS.Fix
/Users/<user>as one logical component, matching the existing home-directory safeguard./Usersand the user’s home directory are excluded while project and sibling-directory watches remain intact.Copilot Checklist
I successfully ran the applicable command at the end of my session, and it completed without error:
/Usersfor projects without a package.json on macOS #65387