From 64d72a8f772e075c946daa5cfd370556c4e29725 Mon Sep 17 00:00:00 2001 From: filipw Date: Thu, 18 Apr 2019 19:25:04 +0200 Subject: [PATCH 1/3] do not hang on nuget references with wildcard --- build/Packages.props | 2 +- src/OmniSharp.MSBuild/ProjectManager.cs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build/Packages.props b/build/Packages.props index 73b4191b94..452e7c3710 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -3,7 +3,7 @@ 16.0.461 - 5.0.0-rtm.5856 + 5.0.0 3.1.0-beta2-19205-01 2.4.0 diff --git a/src/OmniSharp.MSBuild/ProjectManager.cs b/src/OmniSharp.MSBuild/ProjectManager.cs index c6fbdcb480..ec43af6f19 100644 --- a/src/OmniSharp.MSBuild/ProjectManager.cs +++ b/src/OmniSharp.MSBuild/ProjectManager.cs @@ -352,8 +352,6 @@ private void AddProject(ProjectFileInfo projectFileInfo) { _logger.LogInformation($"Adding project '{projectFileInfo.FilePath}'"); - _logger.LogDebug(JObject.FromObject(projectFileInfo).ToString()); - _projectFiles.Add(projectFileInfo); var projectInfo = projectFileInfo.CreateProjectInfo(_assemblyLoader); From e7c891d1c1f81cc71883decf735ff5738d48e0a2 Mon Sep 17 00:00:00 2001 From: filipw Date: Thu, 18 Apr 2019 19:29:53 +0200 Subject: [PATCH 2/3] readme update --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9efbd560b2..1797885aaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All changes to the project will be documented in this file. ## [1.32.xx] - not yet released * Fixed logging for OmniSharp HTTP server (PR: [#1456](https://github.com/OmniSharp/omnisharp-roslyn/pull/1456)) +* Fixed OmniSharp hanging on wildcard Nuget package references (PR: [#1473](https://github.com/OmniSharp/omnisharp-roslyn/pull/1473)) ## [1.32.18] - 2019-04-12 * Renamed `ProjectGuid` to `ProjectId` and no longer hash target framework names on `ProjectConfigurationMessage` (PR: [#1454](https://github.com/OmniSharp/omnisharp-roslyn/pull/1454)) From 7e243e0f30da9f675c9472480d1c81b1bbba5040 Mon Sep 17 00:00:00 2001 From: filipw Date: Thu, 18 Apr 2019 19:47:39 +0200 Subject: [PATCH 3/3] added a test against nuget wildcard reference parsing --- ...._ProjectWithWildcardPackageReference.csproj | Bin 0 -> 4096 bytes .../Program.cs | 12 ++++++++++++ .../ProjectWithWildcardPackageReference.csproj | 13 +++++++++++++ .../WorkspaceInformationTests.cs | 16 ++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 test-assets/test-projects/ProjectWithWildcardPackageReference/._ProjectWithWildcardPackageReference.csproj create mode 100644 test-assets/test-projects/ProjectWithWildcardPackageReference/Program.cs create mode 100644 test-assets/test-projects/ProjectWithWildcardPackageReference/ProjectWithWildcardPackageReference.csproj diff --git a/test-assets/test-projects/ProjectWithWildcardPackageReference/._ProjectWithWildcardPackageReference.csproj b/test-assets/test-projects/ProjectWithWildcardPackageReference/._ProjectWithWildcardPackageReference.csproj new file mode 100644 index 0000000000000000000000000000000000000000..ef1ab86ee7c97cd4b45ad3d1b93628620089cb3b GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vI`oQ7 z9HN6^0Z_RBnifVNA1W@DoS&Kf7%s{i3$kztVg G{~rKbjVjIn literal 0 HcmV?d00001 diff --git a/test-assets/test-projects/ProjectWithWildcardPackageReference/Program.cs b/test-assets/test-projects/ProjectWithWildcardPackageReference/Program.cs new file mode 100644 index 0000000000..5e2df9ec7a --- /dev/null +++ b/test-assets/test-projects/ProjectWithWildcardPackageReference/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace test_wildcard +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/test-assets/test-projects/ProjectWithWildcardPackageReference/ProjectWithWildcardPackageReference.csproj b/test-assets/test-projects/ProjectWithWildcardPackageReference/ProjectWithWildcardPackageReference.csproj new file mode 100644 index 0000000000..f7fd49c2eb --- /dev/null +++ b/test-assets/test-projects/ProjectWithWildcardPackageReference/ProjectWithWildcardPackageReference.csproj @@ -0,0 +1,13 @@ + + + + Exe + netcoreapp2.1 + test_wildcard + + + + + + + diff --git a/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs b/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs index c19edd3073..bbef8022b6 100644 --- a/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs @@ -225,5 +225,21 @@ public async Task AntlrGeneratedFiles() Assert.Contains(project.SourceFiles, fileName => fileName.EndsWith("GrammarParser.cs")); } } + + [Fact] + public async Task ProjectWithWildcardPackageReference() + { + using (var testProject = await TestAssets.Instance.GetTestProjectAsync("ProjectWithWildcardPackageReference")) + using (var host = CreateMSBuildTestHost(testProject.Directory)) + { + var workspaceInfo = await host.RequestMSBuildWorkspaceInfoAsync(); + + Assert.NotNull(workspaceInfo.Projects); + var project = Assert.Single(workspaceInfo.Projects); + + Assert.Equal("ProjectWithWildcardPackageReference.csproj", Path.GetFileName(project.Path)); + Assert.Equal(3, project.SourceFiles.Count); + } + } } }