diff --git a/CHANGELOG.md b/CHANGELOG.md index 3059aed500..dd0fc97f70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All changes to the project will be documented in this file. ## [1.34.12] - not yet released * Fixed out of bounds exception in line mapping ([omnisharp-vscode#3485](https://github.com/OmniSharp/omnisharp-vscode/issues/3485), PR: [#1707](https://github.com/OmniSharp/omnisharp-roslyn/pull/1707)) * Added support for aliases in project references ([#1685](https://github.com/OmniSharp/omnisharp-roslyn/issues/1685), PR: [#1701](https://github.com/OmniSharp/omnisharp-roslyn/pull/1701)) +* Raised the lowest discovered VS2019 version to 16.3 ((#1700)[https://github.com/OmniSharp/omnisharp-roslyn/issues/1700], PR: (#1713)(https://github.com/OmniSharp/omnisharp-roslyn/pull/1713)) ## [1.34.11] - 2020-02-05 * Updated the bundled to Mono 6.8.0 and MSBuild to be copied from Mono 6.8.0 ([#1693](https://github.com/OmniSharp/omnisharp-roslyn/issues/1693), PR: [#1697](https://github.com/OmniSharp/omnisharp-roslyn/pull/1697)) diff --git a/src/OmniSharp.Host/MSBuild/Discovery/Extensions.cs b/src/OmniSharp.Host/MSBuild/Discovery/Extensions.cs index 93d121b678..ad05e59972 100644 --- a/src/OmniSharp.Host/MSBuild/Discovery/Extensions.cs +++ b/src/OmniSharp.Host/MSBuild/Discovery/Extensions.cs @@ -95,7 +95,7 @@ private static int GetInstanceFeatureScore(MSBuildInstance i) score--; // VS 2019 should be preferred - if (i.Version.Major >= 16) + if (i.Version.Major >= 16 && i.Version.Minor >= 3) score++; else score--; diff --git a/src/OmniSharp.Host/MSBuild/Discovery/Providers/MonoInstanceProvider.cs b/src/OmniSharp.Host/MSBuild/Discovery/Providers/MonoInstanceProvider.cs index 235d6fe095..f019ad4f55 100644 --- a/src/OmniSharp.Host/MSBuild/Discovery/Providers/MonoInstanceProvider.cs +++ b/src/OmniSharp.Host/MSBuild/Discovery/Providers/MonoInstanceProvider.cs @@ -112,7 +112,7 @@ public override ImmutableArray GetInstances() new MSBuildInstance( nameof(DiscoveryType.Mono), toolsPath, - new Version(16, 3), + new Version(16, 4), DiscoveryType.Mono, propertyOverrides.ToImmutable())); } diff --git a/src/OmniSharp.Host/MSBuild/Discovery/Providers/StandAloneInstanceProvider.cs b/src/OmniSharp.Host/MSBuild/Discovery/Providers/StandAloneInstanceProvider.cs index 20c8d374f0..b70b44b792 100644 --- a/src/OmniSharp.Host/MSBuild/Discovery/Providers/StandAloneInstanceProvider.cs +++ b/src/OmniSharp.Host/MSBuild/Discovery/Providers/StandAloneInstanceProvider.cs @@ -46,7 +46,7 @@ public override ImmutableArray GetInstances() new MSBuildInstance( nameof(DiscoveryType.StandAlone), toolsPath, - new Version(16, 3), // we now ship with embedded MsBuild 16.3 + new Version(16, 4), // we now ship with embedded MsBuild 16.4 DiscoveryType.StandAlone, propertyOverrides.ToImmutable(), setMSBuildExePathVariable: true)); diff --git a/tests/OmniSharp.MSBuild.Tests/MSBuildSelectionTests.cs b/tests/OmniSharp.MSBuild.Tests/MSBuildSelectionTests.cs index e5aaa6aaf5..d10a22568f 100644 --- a/tests/OmniSharp.MSBuild.Tests/MSBuildSelectionTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/MSBuildSelectionTests.cs @@ -23,7 +23,7 @@ public void RegisterDefaultInstanceFindsTheBestInstanceAvailable() new MSBuildInstance( "Test Instance", TestIO.GetRandomTempFolderPath(), - Version.Parse("16.1.2.3"), + Version.Parse("16.3.2.3"), DiscoveryType.VisualStudioSetup ).AddDotNetCoreToFakeInstance(), GetStandAloneMSBuildInstance() @@ -50,7 +50,7 @@ public void RegisterDefaultInstanceFindsTheBestInstanceAvailableEvenWithOtherVal new MSBuildInstance( "Valid Test Instance", TestIO.GetRandomTempFolderPath(), - Version.Parse("16.3.2.1"), + Version.Parse("16.3.2.3"), DiscoveryType.VisualStudioSetup ), GetInvalidMsBuildInstance(), @@ -59,7 +59,7 @@ public void RegisterDefaultInstanceFindsTheBestInstanceAvailableEvenWithOtherVal new MSBuildInstance( "Another Valid Test Instance", TestIO.GetRandomTempFolderPath(), - Version.Parse("16.1.2.3"), + Version.Parse("16.3.2.1"), DiscoveryType.VisualStudioSetup ).AddDotNetCoreToFakeInstance(), GetStandAloneMSBuildInstance() @@ -107,7 +107,7 @@ public void RegisterDefaultInstanceFindsUserOverrideAvailableEvenWithOtherValidI new MSBuildInstance( "Manually Overridden", TestIO.GetRandomTempFolderPath(), - Version.Parse("99.0.0"), + Version.Parse("1.0.0"), DiscoveryType.UserOverride ).AddDotNetCoreToFakeInstance(), }; @@ -136,7 +136,7 @@ public void RegisterDefaultInstanceStillPrefersTheFirstInstance() new MSBuildInstance( "Test Instance", TestIO.GetRandomTempFolderPath(), - Version.Parse("16.1.2.3"), + Version.Parse("16.3.2.3"), DiscoveryType.VisualStudioSetup ), GetStandAloneMSBuildInstance() @@ -155,22 +155,25 @@ public void RegisterDefaultInstanceStillPrefersTheFirstInstance() msbuildLocator.DeleteFakeInstancesFolders(); } - [Fact] - public void StandAloneIsPreferredOverVS2017() + [Theory] + [InlineData("15.1.2.3")] + [InlineData("16.1.2.3")] + [InlineData("16.2.2.3")] + public void StandAloneIsPreferredOverUnsupportedVS(string vsVersion) { var msBuildInstances = new[] { new MSBuildInstance( "Test Instance", TestIO.GetRandomTempFolderPath(), - Version.Parse("15.1.2.3"), + Version.Parse(vsVersion), DiscoveryType.VisualStudioSetup - ), + ).AddDotNetCoreToFakeInstance(), GetStandAloneMSBuildInstance() }; var msbuildLocator = new MSFakeLocator(msBuildInstances); - var logger = LoggerFactory.CreateLogger(nameof(StandAloneIsPreferredOverVS2017)); + var logger = LoggerFactory.CreateLogger(nameof(StandAloneIsPreferredOverUnsupportedVS)); // test msbuildLocator.RegisterDefaultInstance(logger); @@ -187,9 +190,9 @@ private static MSBuildInstance GetStandAloneMSBuildInstance() return new MSBuildInstance( "Stand Alone :(", TestIO.GetRandomTempFolderPath(), - Version.Parse("16.3.0.0"), + Version.Parse("16.4.0.0"), DiscoveryType.StandAlone - ); + ).AddDotNetCoreToFakeInstance(); } private static MSBuildInstance GetInvalidMsBuildInstance()