Skip to content

Update to 4.14 version #228

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions AspNetCore.Demo.Net6/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@
"MirrorSharp.AspNetCore": {
"type": "Project",
"dependencies": {
"MirrorSharp.Common": "[3.0.9, )"
"MirrorSharp.Common": "[3.0.10, )"
}
},
"MirrorSharp.AspNetCore.Demo.Library": {
Expand All @@ -1332,13 +1332,13 @@
"FSharp.Core": "[8.0.300, )",
"Microsoft.Build.Utilities.Core": "[17.12.6, )",
"Microsoft.IO.RecyclableMemoryStream": "[2.2.0, )",
"MirrorSharp.Common": "[3.0.9, )"
"MirrorSharp.Common": "[3.0.10, )"
}
},
"MirrorSharp.IL": {
"type": "Project",
"dependencies": {
"MirrorSharp.Common": "[3.0.9, )",
"MirrorSharp.Common": "[3.0.10, )",
"Mobius.ILasm": "[0.1.0, )",
"System.Drawing.Common": "[9.0.0, )"
}
Expand Down
11 changes: 3 additions & 8 deletions AspNetCore.Demo/AspNetCore.Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>MirrorSharp.AspNetCore.Demo</AssemblyName>
<RootNamespace>MirrorSharp.AspNetCore.Demo</RootNamespace>
<IsPackable>false</IsPackable>
Expand All @@ -25,15 +25,10 @@

<Target Name="CopySdkReferenceAssemblies" AfterTargets="ResolveReferences">
<ItemGroup>
<Content Include="@(Reference->'%(RootDir)%(Directory)%(Filename)%(Extension)')"
Link="@(Reference->'ref-assemblies\%(Filename)%(Extension)')"
Condition="$([System.String]::new('%(Filename)').StartsWith('System')) or '%(Filename)' == 'netstandard'">
<Content Include="@(Reference->'%(RootDir)%(Directory)%(Filename)%(Extension)')" Link="@(Reference->'ref-assemblies\%(Filename)%(Extension)')" Condition="$([System.String]::new('%(Filename)').StartsWith('System')) or '%(Filename)' == 'netstandard'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="@(Reference->'%(RootDir)%(Directory)%(Filename).xml')"
Link="@(Reference->'ref-assemblies\%(Filename).xml')"
Condition="($([System.String]::new('%(Filename)').StartsWith('System')) or '%(Filename)' == 'netstandard')
and Exists('%(RootDir)%(Directory)%(Filename).xml')">
<Content Include="@(Reference->'%(RootDir)%(Directory)%(Filename).xml')" Link="@(Reference->'ref-assemblies\%(Filename).xml')" Condition="($([System.String]::new('%(Filename)').StartsWith('System')) or '%(Filename)' == 'netstandard')&#xD;&#xA; and Exists('%(RootDir)%(Directory)%(Filename).xml')">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
Expand Down
50 changes: 24 additions & 26 deletions AspNetCore.Demo/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"dependencies": {
".NETCoreApp,Version=v3.1": {
"net8.0": {
"FSharp.Compiler.Service": {
"type": "Transitive",
"resolved": "43.8.300",
Expand Down Expand Up @@ -175,6 +175,11 @@
"System.Security.Principal.Windows": "5.0.0"
}
},
"Microsoft.Win32.SystemEvents": {
"type": "Transitive",
"resolved": "9.0.0",
"contentHash": "z8FfGIaoeALdD+KF44A2uP8PZIQQtDGiXsOLuN8nohbKhkyKt7zGaZb+fKiCxTuBqG22Q7myIAioSWaIcOOrOw=="
},
"Mobius.ILasm": {
"type": "Transitive",
"resolved": "0.1.0",
Expand Down Expand Up @@ -385,11 +390,7 @@
"System.Collections.Immutable": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==",
"dependencies": {
"System.Memory": "4.5.5",
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
"contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg=="
},
"System.Composition": {
"type": "Transitive",
Expand Down Expand Up @@ -492,6 +493,7 @@
"resolved": "8.0.0",
"contentHash": "JlYi9XVvIREURRUlGMr1F6vOFLk7YSY4p1vHo4kX3tQ0AGrjqlRWHDi66ImHhy6qwXBG3BJ6Y1QlYQ+Qz6Xgww==",
"dependencies": {
"System.Diagnostics.EventLog": "8.0.0",
"System.Security.Cryptography.ProtectedData": "8.0.0"
}
},
Expand Down Expand Up @@ -520,11 +522,12 @@
"System.Diagnostics.DiagnosticSource": {
"type": "Transitive",
"resolved": "7.0.2",
"contentHash": "hYr3I9N9811e0Bjf2WNwAGGyTuAFbbTgX1RPLt/3Wbm68x3IGcX5Cl75CMmgT6WlNwLQ2tCCWfqYPpypjaf2xA==",
"dependencies": {
"System.Memory": "4.5.5",
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
"contentHash": "hYr3I9N9811e0Bjf2WNwAGGyTuAFbbTgX1RPLt/3Wbm68x3IGcX5Cl75CMmgT6WlNwLQ2tCCWfqYPpypjaf2xA=="
},
"System.Diagnostics.EventLog": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A=="
},
"System.Diagnostics.Tools": {
"type": "Transitive",
Expand All @@ -549,7 +552,10 @@
"System.Drawing.Common": {
"type": "Transitive",
"resolved": "9.0.0",
"contentHash": "uoozjI3+dlgKh2onFJcz8aNLh6TRCPlLSh8Dbuljc8CdvqXrxHOVysJlrHvlsOCqceqGBR1wrMPxlnzzhynktw=="
"contentHash": "uoozjI3+dlgKh2onFJcz8aNLh6TRCPlLSh8Dbuljc8CdvqXrxHOVysJlrHvlsOCqceqGBR1wrMPxlnzzhynktw==",
"dependencies": {
"Microsoft.Win32.SystemEvents": "9.0.0"
}
},
"System.Globalization": {
"type": "Transitive",
Expand Down Expand Up @@ -822,8 +828,7 @@
"resolved": "7.0.0",
"contentHash": "MclTG61lsD9sYdpNz9xsKBzjsmsfCtcMZYXz/IUr2zlhaTaABonlr1ESeompTgM+Xk+IwtGYU7/voh3YWB/fWw==",
"dependencies": {
"System.Collections.Immutable": "7.0.0",
"System.Memory": "4.5.5"
"System.Collections.Immutable": "7.0.0"
}
},
"System.Reflection.Primitives": {
Expand Down Expand Up @@ -1053,10 +1058,7 @@
"System.Security.Cryptography.ProtectedData": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==",
"dependencies": {
"System.Memory": "4.5.5"
}
"contentHash": "+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg=="
},
"System.Security.Cryptography.X509Certificates": {
"type": "Transitive",
Expand Down Expand Up @@ -1117,11 +1119,7 @@
"System.Text.Encoding.CodePages": {
"type": "Transitive",
"resolved": "7.0.0",
"contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==",
"dependencies": {
"System.Memory": "4.5.5",
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
"contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ=="
},
"System.Text.Encoding.Extensions": {
"type": "Transitive",
Expand Down Expand Up @@ -1228,7 +1226,7 @@
"MirrorSharp.AspNetCore": {
"type": "Project",
"dependencies": {
"MirrorSharp.Common": "[3.0.9, )"
"MirrorSharp.Common": "[3.0.10, )"
}
},
"MirrorSharp.AspNetCore.Demo.Library": {
Expand All @@ -1253,13 +1251,13 @@
"FSharp.Core": "[8.0.300, )",
"Microsoft.Build.Utilities.Core": "[17.12.6, )",
"Microsoft.IO.RecyclableMemoryStream": "[2.2.0, )",
"MirrorSharp.Common": "[3.0.9, )"
"MirrorSharp.Common": "[3.0.10, )"
}
},
"MirrorSharp.IL": {
"type": "Project",
"dependencies": {
"MirrorSharp.Common": "[3.0.9, )",
"MirrorSharp.Common": "[3.0.10, )",
"Mobius.ILasm": "[0.1.0, )",
"System.Drawing.Common": "[9.0.0, )"
}
Expand Down
4 changes: 2 additions & 2 deletions AspNetCore/AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<PropertyGroup>
<AssemblyName>MirrorSharp.AspNetCore</AssemblyName>
<RootNamespace>MirrorSharp.AspNetCore</RootNamespace>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<VersionPrefix>4.0.0</VersionPrefix>
<Description>MirrorSharp ASP.NET Core server. $(DescriptionSuffix)</Description>
<PackageTags>Roslyn;CodeMirror</PackageTags>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App"/>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion AspNetCore/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"dependencies": {
".NETCoreApp,Version=v3.1": {
"net6.0": {
"Microsoft.CodeAnalysis.PublicApiAnalyzers": {
"type": "Direct",
"requested": "[3.3.0, )",
Expand Down
2 changes: 1 addition & 1 deletion Benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>MirrorSharp.Benchmarks</AssemblyName>
<OutputType>Exe</OutputType>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
Expand Down
4 changes: 2 additions & 2 deletions Benchmarks/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"dependencies": {
".NETCoreApp,Version=v3.1": {
"net8.0": {
"BenchmarkDotNet": {
"type": "Direct",
"requested": "[0.11.5, )",
Expand Down Expand Up @@ -1303,7 +1303,7 @@
"type": "Project",
"dependencies": {
"Microsoft.CodeAnalysis.Common": "[3.3.1, )",
"MirrorSharp.Common": "[3.0.9, )",
"MirrorSharp.Common": "[3.0.10, )",
"Newtonsoft.Json": "[13.0.3, )",
"System.Buffers": "[4.5.1, )"
}
Expand Down
2 changes: 1 addition & 1 deletion Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<AssemblyName>MirrorSharp.Common</AssemblyName>
<RootNamespace>MirrorSharp</RootNamespace>
<TargetFrameworks>netstandard2.0; netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0; netstandard2.1</TargetFrameworks>
<VersionPrefix>3.0.10</VersionPrefix>
<Description>MirrorSharp shared server library. $(DescriptionSuffix)</Description>
<PackageTags>Roslyn;CodeMirror</PackageTags>
Expand Down
35 changes: 20 additions & 15 deletions Common/Internal/Roslyn/RoslynInternals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ internal class RoslynInternals {
public RoslynInternals(
ICodeActionInternals codeAction,
IWorkspaceAnalyzerOptionsInternals workspaceAnalyzerOptions,
ISignatureHelpProviderWrapperResolver singatureHelpProviderResolver
ISignatureHelpProviderWrapperResolver signatureHelpProviderResolver
) {
CodeAction = codeAction;
WorkspaceAnalyzerOptions = workspaceAnalyzerOptions;
SingatureHelpProviderResolver = singatureHelpProviderResolver;
SignatureHelpProviderResolver = signatureHelpProviderResolver;
}

public ICodeActionInternals CodeAction { get; }
public IWorkspaceAnalyzerOptionsInternals WorkspaceAnalyzerOptions { get; }
public ISignatureHelpProviderWrapperResolver SingatureHelpProviderResolver { get; }
public ISignatureHelpProviderWrapperResolver SignatureHelpProviderResolver { get; }

public static RoslynInternals Get(CompositionHost compositionHost) {
Argument.NotNull(nameof(compositionHost), compositionHost);
Expand All @@ -47,19 +47,22 @@ private static Assembly LoadInternalsAssemblyWithDependenciesSlowUncached() {
var roslynVersion = RoslynAssemblies.MicrosoftCodeAnalysis.GetName().Version!;
var assembly = LoadInternalsAssemblySlow(roslynVersion);
// CI build. TODO: SharpLab only?
if (roslynVersion.Major == 42 && roslynVersion.Minor == 42) {
if (roslynVersion is { Major: 42, Minor: 42 }) {
// Try previous versions, in case CI is not on newest yet
var fallback = GetAssemblyOrNullIfTypesFailToLoad(assembly)
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 11)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 10)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 9)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 8)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 7)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 6)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 5)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 4)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 3)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 2)));
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 14)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 13)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 12)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 11)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 10)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 9)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 8)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 7)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 6)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 5)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 4)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 3)))
?? GetAssemblyOrNullIfTypesFailToLoad(LoadInternalsAssemblySlow(new Version(4, 2)));
assembly = fallback ?? assembly;
}

Expand Down Expand Up @@ -95,7 +98,9 @@ private static void EnsureInternalsTypesCanLoad(Assembly assembly) {

private static Assembly LoadInternalsAssemblySlow(Version roslynVersion) {
var assemblyName = roslynVersion switch {
{ Major: > 4 } or { Major: 4, Minor: >= 12 } => "MirrorSharp.Internal.Roslyn412.dll",
{ Major: > 4 } or { Major: 4, Minor: >= 14 } => "MirrorSharp.Internal.Roslyn414.dll",
{ Major: 4, Minor: 13 } => "MirrorSharp.Internal.Roslyn413.dll",
{ Major: 4, Minor: 12 } => "MirrorSharp.Internal.Roslyn412.dll",
{ Major: 4, Minor: 11 } => "MirrorSharp.Internal.Roslyn411.dll",
{ Major: 4, Minor: 10 } => "MirrorSharp.Internal.Roslyn410.dll",
{ Major: 4, Minor: 9 } => "MirrorSharp.Internal.Roslyn49.dll",
Expand Down
2 changes: 1 addition & 1 deletion Common/Internal/Roslyn/RoslynLanguageBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ IRoslynLanguageOptions options
);
_roslynInternals = RoslynInternals.Get(_compositionHost);
_defaultSignatureHelpProviders = ImmutableArray.CreateRange(
_roslynInternals.SingatureHelpProviderResolver.GetAllSlow(languageName: Name)
_roslynInternals.SignatureHelpProviderResolver.GetAllSlow(languageName: Name)
);
}

Expand Down
Loading
Loading