Skip to content

Commit 4140091

Browse files
[automated] Merge branch 'main' => 'main-vs-deps' (#77797)
I detected changes in the main branch which have not been merged yet to main-vs-deps. I'm a robot and am configured to help you automatically keep main-vs-deps up to date, so I've opened this PR. This PR merges commits made on main by the following committers: * JoeRobich * dibarbet ## Instructions for merging from UI This PR will not be auto-merged. When pull request checks pass, complete this PR by creating a merge commit, *not* a squash or rebase commit. <img alt="merge button instructions" src="https://i.imgur.com/GepcNJV.png" width="300" /> If this repo does not allow creating merge commits from the GitHub UI, use command line instructions. ## Instructions for merging via command line Run these commands to merge this pull request from the command line. ``` sh git fetch git checkout main git pull --ff-only git checkout main-vs-deps git pull --ff-only git merge --no-ff main # If there are merge conflicts, resolve them and then run git merge --continue to complete the merge # Pushing the changes to the PR branch will re-trigger PR validation. git push https://github.com/dotnet/roslyn HEAD:merge/main-to-main-vs-deps ``` <details> <summary>or if you are using SSH</summary> ``` git push git@github.com:dotnet/roslyn HEAD:merge/main-to-main-vs-deps ``` </details> After PR checks are complete push the branch ``` git push ``` ## Instructions for resolving conflicts :warning: If there are merge conflicts, you will need to resolve them manually before merging. You can do this [using GitHub][resolve-github] or using the [command line][resolve-cli]. [resolve-github]: https://help.github.com/articles/resolving-a-merge-conflict-on-github/ [resolve-cli]: https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/ ## Instructions for updating this pull request Contributors to this repo have permission update this pull request by pushing to the branch 'merge/main-to-main-vs-deps'. This can be done to resolve conflicts or make other changes to this pull request before it is merged. The provided examples assume that the remote is named 'origin'. If you have a different remote name, please replace 'origin' with the name of your remote. ``` git fetch git checkout -b merge/main-to-main-vs-deps origin/main-vs-deps git pull https://github.com/dotnet/roslyn merge/main-to-main-vs-deps (make changes) git commit -m "Updated PR with my changes" git push https://github.com/dotnet/roslyn HEAD:merge/main-to-main-vs-deps ``` <details> <summary>or if you are using SSH</summary> ``` git fetch git checkout -b merge/main-to-main-vs-deps origin/main-vs-deps git pull git@github.com:dotnet/roslyn merge/main-to-main-vs-deps (make changes) git commit -m "Updated PR with my changes" git push git@github.com:dotnet/roslyn HEAD:merge/main-to-main-vs-deps ``` </details> Contact .NET Core Engineering (dotnet/dnceng) if you have questions or issues. Also, if this PR was generated incorrectly, help us fix it. See https://github.com/dotnet/arcade/blob/main/.github/workflows/scripts/inter-branch-merge.ps1.
2 parents 932542a + b7f166d commit 4140091

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LoadedProject.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ public void Dispose()
133133
_projectSystemProject.OutputRefFilePath = newProjectInfo.OutputRefFilePath;
134134
_projectSystemProject.GeneratedFilesOutputDirectory = newProjectInfo.GeneratedFilesOutputDirectory;
135135
_projectSystemProject.CompilationOutputAssemblyFilePath = newProjectInfo.IntermediateOutputFilePath;
136+
_projectSystemProject.DefaultNamespace = newProjectInfo.DefaultNamespace;
136137

137138
if (newProjectInfo.TargetFrameworkIdentifier != null)
138139
{

src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Program.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ static async Task RunAsync(ServerConfiguration serverConfiguration, Cancellation
181181
}
182182
}
183183

184-
static CliRootCommand CreateCommandLineParser()
184+
static CliConfiguration CreateCommandLineParser()
185185
{
186186
var debugOption = new CliOption<bool>("--debug")
187187
{
@@ -277,6 +277,7 @@ static CliRootCommand CreateCommandLineParser()
277277
serverPipeNameOption,
278278
useStdIoOption
279279
};
280+
280281
rootCommand.SetAction((parseResult, cancellationToken) =>
281282
{
282283
var launchDebugger = parseResult.GetValue(debugOption);
@@ -308,7 +309,16 @@ static CliRootCommand CreateCommandLineParser()
308309

309310
return RunAsync(serverConfiguration, cancellationToken);
310311
});
311-
return rootCommand;
312+
313+
var config = new CliConfiguration(rootCommand)
314+
{
315+
// By default, System.CommandLine will catch all exceptions, log them to the console, and return a non-zero exit code.
316+
// Unfortunately this makes .NET's crash dump collection environment variables (e.g. 'DOTNET_DbgEnableMiniDump')
317+
// entirely useless as it never detects an actual crash. Disable this behavior so we can collect crash dumps when asked to.
318+
EnableDefaultExceptionHandler = false
319+
};
320+
321+
return config;
312322
}
313323

314324
static (string clientPipe, string serverPipe) CreateNewPipeNames()

src/Workspaces/MSBuild/BuildHost/MSBuild/ProjectFile/ProjectFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ private ImmutableArray<string> GetRelativeFolders(MSB.Framework.ITaskItem docume
274274
{
275275
var filePath = documentItem.ItemSpec;
276276
var relativePath = PathUtilities.GetDirectoryName(PathUtilities.GetRelativePath(_projectDirectory, filePath));
277-
var folders = relativePath == null ? [] : relativePath.Split(PathUtilities.DirectorySeparatorChar, PathUtilities.AltDirectorySeparatorChar).ToImmutableArray();
277+
var folders = relativePath == null ? [] : relativePath.Split([PathUtilities.DirectorySeparatorChar, PathUtilities.AltDirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries).ToImmutableArray();
278278
return folders;
279279
}
280280
}

src/Workspaces/MSBuild/Test/NetCoreTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,10 @@ public async Task TestOpenProject_VBNetCoreAppWithGlobalImportAndLibrary()
503503
// Assert that there is a project reference between VBProject.vbproj and Library.csproj
504504
AssertSingleProjectReference(project, libraryFilePath);
505505

506-
// Assert that the project does not have any diagnostics in Program.vb
507506
var document = project.Documents.First(d => d.Name == "Program.vb");
507+
Assert.Empty(document.Folders);
508+
509+
// Assert that the project does not have any diagnostics in Program.vb
508510
var semanticModel = await document.GetSemanticModelAsync();
509511
var diagnostics = semanticModel.GetDiagnostics();
510512
Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning));

src/Workspaces/MSBuild/Test/VisualStudioMSBuildWorkspaceTests.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@
1414
using System.Threading;
1515
using System.Threading.Tasks;
1616
using System.Xml.Linq;
17+
using Microsoft.CodeAnalysis.CSharp;
1718
using Microsoft.CodeAnalysis.Diagnostics;
1819
using Microsoft.CodeAnalysis.Host;
1920
using Microsoft.CodeAnalysis.Host.Mef;
2021
using Microsoft.CodeAnalysis.Test.Utilities;
2122
using Microsoft.CodeAnalysis.Text;
2223
using Microsoft.CodeAnalysis.UnitTests;
2324
using Microsoft.CodeAnalysis.UnitTests.TestFiles;
25+
using Microsoft.VisualStudio.Threading;
2426
using Roslyn.Test.Utilities;
2527
using Roslyn.Utilities;
2628
using Xunit;
27-
using static Microsoft.CodeAnalysis.MSBuild.UnitTests.SolutionGeneration;
29+
using Xunit.Abstractions;
2830
using static Microsoft.CodeAnalysis.CSharp.LanguageVersionFacts;
31+
using static Microsoft.CodeAnalysis.MSBuild.UnitTests.SolutionGeneration;
2932
using CS = Microsoft.CodeAnalysis.CSharp;
3033
using VB = Microsoft.CodeAnalysis.VisualBasic;
31-
using Microsoft.CodeAnalysis.CSharp;
32-
using Microsoft.VisualStudio.Threading;
33-
using Xunit.Abstractions;
3434

3535
namespace Microsoft.CodeAnalysis.MSBuild.UnitTests
3636
{
@@ -63,6 +63,7 @@ public async Task TestOpenSolution_SingleProjectSolution()
6363
var solution = await workspace.OpenSolutionAsync(solutionFilePath);
6464
var project = solution.Projects.First();
6565
var document = project.Documents.First();
66+
Assert.Empty(document.Folders);
6667
var tree = await document.GetSyntaxTreeAsync();
6768
var type = tree.GetRoot().DescendantTokens().First(t => t.ToString() == "class").Parent;
6869
Assert.NotNull(type);

0 commit comments

Comments
 (0)