Skip to content
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

Update Roslyn to 4.12.0-1.24358.3 #2619

Merged
merged 7 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests-net6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
matrix:
os: [ubuntu-20.04, windows-2022, macos-12]
testProjects:
- OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.Cake.Tests,OmniSharp.Script.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests,OmniSharp.Tests,OmniSharp.Lsp.Tests
- OmniSharp.DotNetTest.Tests
- OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.DotNetTest.Tests,OmniSharp.Cake.Tests
- OmniSharp.Lsp.Tests,OmniSharp.Script.Tests,OmniSharp.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests
name: 'Test'
steps:
- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
matrix:
os: [ubuntu-20.04, windows-2022, macos-12]
testProjects:
- OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.Cake.Tests,OmniSharp.Script.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests,OmniSharp.Tests,OmniSharp.Lsp.Tests
- OmniSharp.DotNetTest.Tests
- OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.DotNetTest.Tests,OmniSharp.Cake.Tests
- OmniSharp.Lsp.Tests,OmniSharp.Script.Tests,OmniSharp.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests
name: 'Test'
steps:
- name: Checkout
Expand Down
58 changes: 20 additions & 38 deletions .pipelines/init.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
parameters:
# Configuration: Release
Verbosity: Normal
DotNetVersion: "9.0.100-preview.1.24101.2"
DotNetVersion2: "8.0.201"
DotNetVersion3: "7.0.406"
DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests.
DotNetVersion: "8.0.201"
CakeVersion: "1.1.0"
NuGetVersion: "5.7.0"
MonoVersion: ''
MonoVersion: ""
steps:
- task: DownloadBuildArtifacts@0
displayName: "Download GitVersion Variables"
Expand All @@ -18,58 +15,43 @@ steps:
pipelineId: GitVersion
targetPath: "$(Build.ArtifactStagingDirectory)/gitversion/"
- task: RocketSurgeonsGuild.variable-tools.DeserializeVariables.DeserializeVariables@1
displayName: 'Deserialize GitVersion'
displayName: "Deserialize GitVersion"
inputs:
jsonfiles: $(Build.ArtifactStagingDirectory)/gitversion/**/gitversion.json
- task: UseDotNet@2
displayName: Install dotnet $(DotNetVersion)
inputs:
packageType: 'sdk'
packageType: "sdk"
version: ${{ parameters.DotNetVersion }}
- task: UseDotNet@2
displayName: Install dotnet $(DotNetVersion2)
inputs:
packageType: 'sdk'
version: ${{ parameters.DotNetVersion2 }}
- task: UseDotNet@2
displayName: Install dotnet $(DotNetVersion3)
inputs:
packageType: 'sdk'
version: ${{ parameters.DotNetVersion3 }}
- task: UseDotNet@2
displayName: Install dotnet $(DotNetVersion4)
inputs:
packageType: 'sdk'
version: ${{ parameters.DotNetVersion4 }}
- task: DotNetCoreCLI@2
displayName: 'dotnet install cake'
displayName: "dotnet install cake"
inputs:
command: custom
custom: tool
arguments: 'install -g Cake.Tool --version $(CakeVersion)'
workingDirectory: '$(Build.ArtifactStagingDirectory)'
arguments: "install -g Cake.Tool --version $(CakeVersion)"
workingDirectory: "$(Build.ArtifactStagingDirectory)"
env:
CakeVersion: ${{ parameters.CakeVersion }}
- task: NuGetToolInstaller@0
displayName: "Get NuGet"
inputs:
versionSpec: ${{ parameters.NuGetVersion }}
- task: NuGetCommand@2
displayName: 'Cake restore packages.config'
displayName: "Cake restore packages.config"
inputs:
command: custom
feedsToUse: config
arguments: install tools/packages.config -ExcludeVersion -OutputDirectory tools
- ${{ if ne(parameters.MonoVersion, '') }}:
- script: |
curl -o mono.pkg https://download.mono-project.com/archive/$MONO_VERSION/macos-10-universal/MonoFramework-MDK-$MONO_VERSION.182.macos10.xamarin.universal.pkg
sudo installer -pkg mono.pkg -target /
sudo cp -rf /Library/Frameworks/Mono.framework/Versions/$MONO_VERSION/ /Library/Frameworks/Mono.framework/Versions/Current/
MONOPREFIX=/Library/Frameworks/Mono.framework/Versions/$MONO_VERSION
echo "##vso[task.setvariable variable=DYLD_FALLBACK_LIBRARY_PATH;]$MONOPREFIX/lib:/lib:/usr/lib:$DYLD_LIBRARY_FALLBACK_PATH"
echo "##vso[task.setvariable variable=PKG_CONFIG_PATH;]$MONOPREFIX/lib/pkgconfig:$MONOPREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
echo "##vso[task.setvariable variable=PATH;]$MONOPREFIX/bin:$PATH"
env:
MONO_VERSION: ${{ parameters.MonoVersion }}
displayName: Use Mono ${{ parameters.MonoVersion }}
failOnStderr: false
- script: |
curl -o mono.pkg https://download.mono-project.com/archive/$MONO_VERSION/macos-10-universal/MonoFramework-MDK-$MONO_VERSION.182.macos10.xamarin.universal.pkg
sudo installer -pkg mono.pkg -target /
sudo cp -rf /Library/Frameworks/Mono.framework/Versions/$MONO_VERSION/ /Library/Frameworks/Mono.framework/Versions/Current/
MONOPREFIX=/Library/Frameworks/Mono.framework/Versions/$MONO_VERSION
echo "##vso[task.setvariable variable=DYLD_FALLBACK_LIBRARY_PATH;]$MONOPREFIX/lib:/lib:/usr/lib:$DYLD_LIBRARY_FALLBACK_PATH"
echo "##vso[task.setvariable variable=PKG_CONFIG_PATH;]$MONOPREFIX/lib/pkgconfig:$MONOPREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
echo "##vso[task.setvariable variable=PATH;]$MONOPREFIX/bin:$PATH"
env:
MONO_VERSION: ${{ parameters.MonoVersion }}
displayName: Use Mono ${{ parameters.MonoVersion }}
failOnStderr: false
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<MicrosoftTestPackageVersion>17.8.0</MicrosoftTestPackageVersion>
<MSBuildPackageVersion>17.3.2</MSBuildPackageVersion>
<NuGetPackageVersion>6.11.0-rc.110</NuGetPackageVersion>
<RoslynPackageVersion>4.10.0-2.24112.8</RoslynPackageVersion>
<RoslynPackageVersion>4.12.0-1.24358.3</RoslynPackageVersion>
<XunitPackageVersion>2.6.1</XunitPackageVersion>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions build.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"TestProjects": [
"OmniSharp.MSBuild.Tests",
"OmniSharp.Roslyn.CSharp.Tests",
"OmniSharp.DotNetTest.Tests",
"OmniSharp.Lsp.Tests",
"OmniSharp.DotNetTest.Tests",
"OmniSharp.Script.Tests",
"OmniSharp.Cake.Tests",
"OmniSharp.Http.Tests",
Expand Down Expand Up @@ -55,4 +55,4 @@
"RestoreOnlyTestAssets": [
"ProjectWithMissingType"
]
}
}
2 changes: 1 addition & 1 deletion src/OmniSharp.Abstractions/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ internal static class Configuration
{
public static bool ZeroBasedIndices = false;

public const string RoslynVersion = "4.10.0.0";
public const string RoslynVersion = "4.12.0.0";
public const string RoslynPublicKeyToken = "31bf3856ad364e35";

public readonly static string RoslynFeatures = GetRoslynAssemblyFullName("Microsoft.CodeAnalysis.Features");
Expand Down
4 changes: 3 additions & 1 deletion tests/OmniSharp.Cake.Tests/BlockStructureFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ void M()[|
.ToArray();

var expected = testFile.Content.GetSpans()
.Select(span => testFile.Content.GetRangeFromSpan(span).ToRange()).ToArray();
.Select(span => testFile.Content.GetRangeFromSpan(span).ToRange())
.Reverse()
.ToArray();

Assert.Equal(expected, lineSpans);
}
Expand Down
15 changes: 11 additions & 4 deletions tests/OmniSharp.Lsp.Tests/OmnisharpCompletionHandlerFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1561,11 +1561,18 @@ private async Task<CompletionList> FindCompletionsWithImportedAsync(string filen
return completions;
}

// Populating the completion list should take no more than a few ms, don't let it take too
// Populating the completion cache should take no more than a few ms, don't let it take too
// long
await Task.Delay(ImportCompletionTimeout);

completions = await FindCompletionsAsync(filename, source);
CancellationTokenSource cts = new CancellationTokenSource(millisecondsDelay: ImportCompletionTimeout);
await Task.Run(async () =>
{
while (completions.IsIncomplete)
{
await Task.Delay(100);
completions = await FindCompletionsAsync(filename, source);
cts.Token.ThrowIfCancellationRequested();
}
}, cts.Token);

Assert.False(completions.IsIncomplete);
return completions;
Expand Down
4 changes: 3 additions & 1 deletion tests/OmniSharp.Roslyn.CSharp.Tests/BlockStructureFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ void M()[|
.ToArray();

var expected = testFile.Content.GetSpans()
.Select(span => testFile.Content.GetRangeFromSpan(span).ToRange()).ToArray();
.Select(span => testFile.Content.GetRangeFromSpan(span).ToRange())
.Reverse()
.ToArray();

Assert.Equal(expected, lineSpans);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/OmniSharp.Script.Tests/ScriptProjectProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void DefaultLanguageVersionShouldBeLatest()
var scriptProjectProvider = new ScriptProjectProvider(new ScriptOptions(), new OmniSharpEnvironment(), new LoggerFactory(), true, false);
var scriptProjectInfo = scriptProjectProvider.CreateProject("test.csx", Enumerable.Empty<MetadataReference>(), Path.GetTempPath(), typeof(CommandLineScriptGlobals));
Assert.Equal(LanguageVersion.Latest, ((CSharpParseOptions)scriptProjectInfo.ParseOptions).SpecifiedLanguageVersion);
Assert.Equal(LanguageVersion.CSharp12, ((CSharpParseOptions)scriptProjectInfo.ParseOptions).LanguageVersion);
Assert.Equal(LanguageVersion.CSharp13, ((CSharpParseOptions)scriptProjectInfo.ParseOptions).LanguageVersion);
}
}
}
Loading