Browse Source

Fix dotnet-format to v8 via transport feed for dotnet8. See also PR #2747

pull/3238/head
Christoph Wille 1 year ago
parent
commit
28b7280741
  1. 2
      .github/workflows/build-ilspy.yml
  2. 4
      BuildTools/pre-commit
  3. 32
      ICSharpCode.ILSpyX/Analyzers/AnalyzerContext.cs

2
.github/workflows/build-ilspy.yml

@ -35,7 +35,7 @@ jobs: @@ -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

4
BuildTools/pre-commit

@ -5,10 +5,10 @@ @@ -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

32
ICSharpCode.ILSpyX/Analyzers/AnalyzerContext.cs

@ -44,15 +44,15 @@ namespace ICSharpCode.ILSpyX.Analyzers @@ -44,15 +44,15 @@ namespace ICSharpCode.ILSpyX.Analyzers
/// </summary>
public required ILanguage Language { get; init; }
/// <summary>
/// Allows the analyzer to control whether the tree nodes will be sorted.
/// Must be set within <see cref="IAnalyzer.Analyze(ISymbol, AnalyzerContext)"/>
/// before the results are enumerated.
/// </summary>
public bool SortResults { get; set; }
/// <summary>
/// Allows the analyzer to control whether the tree nodes will be sorted.
/// Must be set within <see cref="IAnalyzer.Analyze(ISymbol, AnalyzerContext)"/>
/// before the results are enumerated.
/// </summary>
public bool SortResults { get; set; }
public MethodBodyBlock? GetMethodBody(IMethod method)
{
public MethodBodyBlock? GetMethodBody(IMethod method)
{
if (!method.HasBody || method.MetadataToken.IsNil || method.ParentModule?.MetadataFile == null)
return null;
var module = method.ParentModule.MetadataFile;
@ -65,18 +65,18 @@ public MethodBodyBlock? GetMethodBody(IMethod method) @@ -65,18 +65,18 @@ public MethodBodyBlock? GetMethodBody(IMethod method)
{
return null;
}
}
}
public AnalyzerScope GetScopeOf(IEntity entity)
{
public AnalyzerScope GetScopeOf(IEntity entity)
{
return new AnalyzerScope(AssemblyList, entity);
}
}
readonly ConcurrentDictionary<MetadataFile, DecompilerTypeSystem> typeSystemCache = new();
readonly ConcurrentDictionary<MetadataFile, DecompilerTypeSystem> typeSystemCache = new();
public DecompilerTypeSystem GetOrCreateTypeSystem(MetadataFile module)
{
public DecompilerTypeSystem GetOrCreateTypeSystem(MetadataFile module)
{
return typeSystemCache.GetOrAdd(module, m => new DecompilerTypeSystem(m, m.GetAssemblyResolver()));
}
}
}
}

Loading…
Cancel
Save