dotnet / dotnet/roslyn

Language server should not restore projects forked from the canonical project

Open
#82,999 0 comments 0 reactions 0 assignees View on GitHub
Area-IDE
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

After #82509 I observed a behavior where opening a pull request diff caused an endless restore popup to appear.

The logs indicated that a restore was being performed for a virtual file (not present on disk).

Restarting VS Code made the restore popup stop appearing, so, perhaps somehow a necessary asset was restored to the canonical project, only after the first run.

I think we should probably have a sanity check in the restore helper or in the LanguageServerProjectLoader before it calls the restore helper, to ensure it is only ever performed on a file which exists on disk.

This might also be a symptom that the "project file" for the miscellaneous files project, should not be the path of the document we created the project for, but, for "canonical forked" cases, should perhaps still be the path to the canonical file we dropped to the temp directory.

Contributor guide

Open the contributing guide

Research direction

Start with the restore helper and LanguageServerProjectLoader, using the reported pull request diff scenario in VS Code to reproduce the endless restore popup. Trace how virtual files and canonical forked projects select their project file, then verify that restore is not attempted for a file absent from disk and that the canonical file path is preserved where appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.