diff --git a/.github/workflows/build-ilspy.yml b/.github/workflows/build-ilspy.yml index 444d22b3c..10e5d8e9d 100644 --- a/.github/workflows/build-ilspy.yml +++ b/.github/workflows/build-ilspy.yml @@ -35,7 +35,7 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: Install dotnet-format - run: dotnet tool install -g dotnet-format --version "6.2.315104" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json + run: dotnet tool install -g dotnet-format --version "8.0.453106" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json - name: Get Version id: version diff --git a/BuildTools/pre-commit b/BuildTools/pre-commit index a55e3bdc4..4f2cfb446 100644 --- a/BuildTools/pre-commit +++ b/BuildTools/pre-commit @@ -5,10 +5,10 @@ set -eu -DOTNET_FORMAT_VERSION=6.2.315104 +DOTNET_FORMAT_VERSION=8.0.453106 DOTNET_PATH="$LOCALAPPDATA/ICSharpCode/ILSpy/dotnet-format-$DOTNET_FORMAT_VERSION" if [ ! -d "$DOTNET_PATH" ]; then - dotnet tool install --tool-path "$DOTNET_PATH" dotnet-format --version "$DOTNET_FORMAT_VERSION" --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" + dotnet tool install --tool-path "$DOTNET_PATH" dotnet-format --version "$DOTNET_FORMAT_VERSION" --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" fi "$DOTNET_PATH/dotnet-format.exe" --version diff --git a/ICSharpCode.ILSpyX/Analyzers/AnalyzerContext.cs b/ICSharpCode.ILSpyX/Analyzers/AnalyzerContext.cs index 09112056f..1c339ef0a 100644 --- a/ICSharpCode.ILSpyX/Analyzers/AnalyzerContext.cs +++ b/ICSharpCode.ILSpyX/Analyzers/AnalyzerContext.cs @@ -34,49 +34,49 @@ namespace ICSharpCode.ILSpyX.Analyzers { public required AssemblyList AssemblyList { get; init; } - /// - /// CancellationToken. Currently Analyzers do not support cancellation from the UI, but it should be checked nonetheless. - /// - public CancellationToken CancellationToken { get; init; } + /// + /// CancellationToken. Currently Analyzers do not support cancellation from the UI, but it should be checked nonetheless. + /// + public CancellationToken CancellationToken { get; init; } - /// - /// Currently used language. - /// - public required ILanguage Language { get; init; } + /// + /// Currently used language. + /// + public required ILanguage Language { get; init; } -/// -/// Allows the analyzer to control whether the tree nodes will be sorted. -/// Must be set within -/// before the results are enumerated. -/// -public bool SortResults { get; set; } + /// + /// Allows the analyzer to control whether the tree nodes will be sorted. + /// Must be set within + /// before the results are enumerated. + /// + public bool SortResults { get; set; } -public MethodBodyBlock? GetMethodBody(IMethod method) -{ - if (!method.HasBody || method.MetadataToken.IsNil || method.ParentModule?.MetadataFile == null) - return null; - var module = method.ParentModule.MetadataFile; - var md = module.Metadata.GetMethodDefinition((MethodDefinitionHandle)method.MetadataToken); - try - { - return module.GetMethodBody(md.RelativeVirtualAddress); - } - catch (BadImageFormatException) - { - return null; - } -} + public MethodBodyBlock? GetMethodBody(IMethod method) + { + if (!method.HasBody || method.MetadataToken.IsNil || method.ParentModule?.MetadataFile == null) + return null; + var module = method.ParentModule.MetadataFile; + var md = module.Metadata.GetMethodDefinition((MethodDefinitionHandle)method.MetadataToken); + try + { + return module.GetMethodBody(md.RelativeVirtualAddress); + } + catch (BadImageFormatException) + { + return null; + } + } -public AnalyzerScope GetScopeOf(IEntity entity) -{ - return new AnalyzerScope(AssemblyList, entity); -} + public AnalyzerScope GetScopeOf(IEntity entity) + { + return new AnalyzerScope(AssemblyList, entity); + } -readonly ConcurrentDictionary typeSystemCache = new(); + readonly ConcurrentDictionary typeSystemCache = new(); -public DecompilerTypeSystem GetOrCreateTypeSystem(MetadataFile module) -{ - return typeSystemCache.GetOrAdd(module, m => new DecompilerTypeSystem(m, m.GetAssemblyResolver())); -} + public DecompilerTypeSystem GetOrCreateTypeSystem(MetadataFile module) + { + return typeSystemCache.GetOrAdd(module, m => new DecompilerTypeSystem(m, m.GetAssemblyResolver())); + } } }