From 09f5daab33d426f4e1b57b9b5a0f95470aea99c5 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Mon, 12 Feb 2024 14:46:45 +0000 Subject: [PATCH] Update FSharp.Analyzers.SDK to 0.24.0 (#1229) * Update FSharp.Analyzers.SDK to 0.24.0 * Add changelog entry --- CHANGELOG.md | 5 +++++ paket.dependencies | 2 +- paket.lock | 12 ++++++------ .../LspServers/AdaptiveServerState.fs | 13 ++++++------- test/OptionAnalyzer/Analyzer.fs | 2 +- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 700b9d71b..f442a44a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Unreleased + +### Changed + +* [Analyzers: Update analyzers support to 0.24.0](https://github.com/fsharp/FsAutoComplete/pull/1229) (thanks @nojaf) ## [0.69.0] - 2024-01-14 diff --git a/paket.dependencies b/paket.dependencies index f6e32a78a..ccb39f1f8 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -26,7 +26,7 @@ nuget Microsoft.Build.Utilities.Core >= 17.4 copy_local:false nuget Microsoft.Build.Tasks.Core >= 17.4 copy_local: false nuget Nuget.Frameworks >= 6.3 copy_local: false nuget Microsoft.CodeAnalysis 4.5.0 -nuget FSharp.Analyzers.SDK 0.23.0 +nuget FSharp.Analyzers.SDK 0.24.0 nuget ICSharpCode.Decompiler nuget Mono.Cecil >= 0.11.4 nuget FSharpLint.Core diff --git a/paket.lock b/paket.lock index d8f6ff062..9ecb1b61a 100644 --- a/paket.lock +++ b/paket.lock @@ -56,7 +56,7 @@ NUGET FParsec (1.1.1) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0)) FSharp.Core (>= 4.3.4) FSharp.Analyzers.Build (0.3) - FSharp.Analyzers.SDK (0.23) + FSharp.Analyzers.SDK (0.24) FSharp.Compiler.Service (43.8.100) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) FSharp.Core (8.0.100) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) McMaster.NETCore.Plugins (>= 1.4) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) @@ -139,21 +139,21 @@ NUGET StreamJsonRpc (>= 2.16.36) Ionide.ProjInfo (0.63) FSharp.Core (>= 7.0.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) - Ionide.ProjInfo.Sln (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Ionide.ProjInfo.Sln (>= 0.63) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) Microsoft.Build (>= 17.2) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) Microsoft.Build.Framework (>= 17.2) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) SemanticVersioning (>= 2.0.2) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) Ionide.ProjInfo.FCS (0.63) FSharp.Compiler.Service (>= 43.7.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) FSharp.Core (>= 7.0.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) - Ionide.ProjInfo (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Ionide.ProjInfo (>= 0.63) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) Ionide.ProjInfo.ProjectSystem (0.63) FSharp.Compiler.Service (>= 43.7.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) FSharp.Control.Reactive (>= 5.0.5) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) FSharp.Core (>= 7.0.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) - Ionide.ProjInfo (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) - Ionide.ProjInfo.FCS (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) - Ionide.ProjInfo.Sln (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Ionide.ProjInfo (>= 0.63) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Ionide.ProjInfo.FCS (>= 0.63) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Ionide.ProjInfo.Sln (>= 0.63) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) Newtonsoft.Json (>= 13.0.1) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) Ionide.ProjInfo.Sln (0.63) LinkDotNet.StringBuilder (1.18) diff --git a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs index 01973474c..ee8f95ff8 100644 --- a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs +++ b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs @@ -168,12 +168,11 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac System.IO.Path.Combine(workspacePath, analyzerPath) Loggers.analyzers.info (Log.setMessageI $"Loading analyzers from {dir:dir}") - - let (dllCount, analyzerCount) = analyzersClient.LoadAnalyzers(dir, excludeInclude) + let assemblyLoadStats = analyzersClient.LoadAnalyzers(dir, excludeInclude) Loggers.analyzers.info ( Log.setMessageI - $"From {analyzerPath:name}: {dllCount:dllNo} dlls including {analyzerCount:analyzersNo} analyzers" + $"From {analyzerPath:name}: {assemblyLoadStats.AnalyzerAssemblies:dllNo} dlls including {assemblyLoadStats.Analyzers:analyzersNo} analyzers" )) else @@ -569,10 +568,10 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac let severity = match m.Severity with - | FSharp.Analyzers.SDK.Hint -> DiagnosticSeverity.Hint - | FSharp.Analyzers.SDK.Info -> DiagnosticSeverity.Information - | FSharp.Analyzers.SDK.Warning -> DiagnosticSeverity.Warning - | FSharp.Analyzers.SDK.Error -> DiagnosticSeverity.Error + | FSharp.Analyzers.SDK.Severity.Hint -> DiagnosticSeverity.Hint + | FSharp.Analyzers.SDK.Severity.Info -> DiagnosticSeverity.Information + | FSharp.Analyzers.SDK.Severity.Warning -> DiagnosticSeverity.Warning + | FSharp.Analyzers.SDK.Severity.Error -> DiagnosticSeverity.Error let fixes = match m.Fixes with diff --git a/test/OptionAnalyzer/Analyzer.fs b/test/OptionAnalyzer/Analyzer.fs index faca8bdb9..9d46e58b1 100644 --- a/test/OptionAnalyzer/Analyzer.fs +++ b/test/OptionAnalyzer/Analyzer.fs @@ -145,7 +145,7 @@ let optionValueAnalyzer: Analyzer = { Type = "Option.Value analyzer" Message = "Option.Value shouldn't be used" Code = "OV001" - Severity = Warning + Severity = Severity.Warning Range = r Fixes = [] }) |> Seq.toList