Skip to content

fix(4019): skip unloaded projects during file rename#4028

Draft
dcsid wants to merge 2 commits into
microsoft:mainfrom
dcsid:fix-4019-file-rename-crash
Draft

fix(4019): skip unloaded projects during file rename#4028
dcsid wants to merge 2 commits into
microsoft:mainfrom
dcsid:fix-4019-file-rename-crash

Conversation

@dcsid
Copy link
Copy Markdown

@dcsid dcsid commented May 22, 2026

Fixes #4019

Skip projects without loaded programs when collecting language services for workspace/willRenameFiles. After a watched file rename in a composite project, the session can include a solution/config project whose program is not loaded; constructing a file-rename language service for that project caused a nil pointer panic at program.Options().

This keeps file rename edits scoped to projects that actually have loaded programs, matching the expectations of LanguageService.

Adds an LSP regression test covering the composite-project rename + workspace/didChangeWatchedFiles scenario from the issue.

Testing

  • npx hereby all-checks

AI Assistance

This PR was authored with AI assistance. I reviewed and understand the changes and will respond to review feedback.

@dcsid
Copy link
Copy Markdown
Author

dcsid commented May 22, 2026

@microsoft-github-policy-service agree

@DanielRosenwasser
Copy link
Copy Markdown
Member

DanielRosenwasser commented May 22, 2026

Are we going to miss rename locations in any unloaded programs? In other words, should we be loading the programs on the fly? If not, whose responsibility is it to do that?

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.

Crash on file rename + workspace/didChangeWatchedFiles, \w composite option enabled

2 participants