Skip to content

Avoid recursive LSP watches on macOS home-directory roots - #65393

Open
Jake Bailey (jakebailey) with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-recursive-watch-on-users
Open

Jake Bailey (jakebailey) with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-recursive-watch-on-users

Conversation

Copilot AI commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Watch roots: Group /Users/<user> as one logical component, matching the existing home-directory safeguard.
  • Regression coverage: Verify that /Users and 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:

  • npx hereby validate
  • npx hereby validate --api (for TypeScript API changes)

Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
@jakebailey Jake Bailey (jakebailey) added the Domain: Performance Performance related label Nov 8, 2026
Copilot AI changed the title [WIP] Fix LSP recursive watch on /Users without package.json Avoid recursive LSP watches on macOS home-directory roots Nov 8, 2026

@jakebailey Jake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, exactly this

@jakebailey
Jake Bailey (jakebailey) marked this pull request as ready for review November 8, 2026 12:08
Copilot AI balanced review requested due to automatic review settings November 8, 2026 12:08

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.

🟡 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

Comment thread tsc/internal/project/watch.go Resolved
Copilot AI and others added 2 commits November 8, 2026 12:23
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>

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.

🟢 Approval recommended

There are no active review issues for the macOS home-directory watch safeguard changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

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

Author: Team Domain: Performance Performance related For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LSP registers a recursive watch on /Users for projects without a package.json on macOS

3 participants