-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Ensure sln load uses project absolute paths #78772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -57,7 +57,7 @@ public async Task OpenSolutionAsync(string solutionFilePath) | |||
_logger.LogInformation(string.Format(LanguageServerResources.Loading_0, solutionFilePath)); | |||
ProjectFactory.SolutionPath = solutionFilePath; | |||
|
|||
var (_, projects) = await SolutionFileReader.ReadSolutionFileAsync(solutionFilePath, CancellationToken.None); | |||
var (_, projects) = await SolutionFileReader.ReadSolutionFileAsync(solutionFilePath, DiagnosticReportingMode.Throw, CancellationToken.None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want something else here or are we going to throw exceptions and not load a solution that we could mostly load? (this question is not blocking considering the regression you're fixing here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this generally matches prior behavior, but I'll do some tests to see if we can relax it and load slns with potentially invalid projects. Will followup.
@@ -1002,13 +1002,11 @@ public async Task TestOpenSolution_WithLockedFile_LoadsWithEmptyText() | |||
public async Task TestOpenSolution_WithInvalidProjectPath_SkipTrue_SucceedsWithFailureEvent() | |||
{ | |||
// when skipped we should see a diagnostic for the invalid project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the test was never testing what it claimed to test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It kind of was. But it was setting the wrong flag to allow it to create the diagnostic
fixes issue found by integration tests in dotnet/vscode-csharp#8331
The new solution parser API gives us relative paths, but contracts in the project system require absolute paths