From 8de7ef39dee165963cdd02888556d3033b2428b0 Mon Sep 17 00:00:00 2001 From: dawe Date: Fri, 22 Dec 2023 18:39:52 +0100 Subject: [PATCH 01/10] bump FSharp.Analyzers.SDK to 0.22.0 --- paket.dependencies | 2 +- paket.lock | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/paket.dependencies b/paket.dependencies index 211831f02..9e40852a1 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 +nuget FSharp.Analyzers.SDK 0.22.0 nuget ICSharpCode.Decompiler nuget Mono.Cecil >= 0.11.4 nuget FSharpLint.Core diff --git a/paket.lock b/paket.lock index 474f86cf7..6acdb0680 100644 --- a/paket.lock +++ b/paket.lock @@ -57,10 +57,11 @@ NUGET FSharp.Core (>= 4.3.4) FSharp.Analyzers.Build (0.2) NETStandard.Library (>= 1.6.1) - FSharp.Analyzers.SDK (0.11) - FSharp.Compiler.Service (>= 41.0.1) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0)) - FSharp.Core (>= 6.0.1) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0)) - McMaster.NETCore.Plugins (>= 1.4) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0)) + FSharp.Analyzers.SDK (0.22) + 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)) + Microsoft.Extensions.Logging.Abstractions (>= 8.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) FSharp.Compiler.Service (43.8.100) FSharp.Core (8.0.100) System.Buffers (>= 4.5.1) @@ -157,7 +158,7 @@ NUGET Newtonsoft.Json (>= 13.0.1) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) Ionide.ProjInfo.Sln (0.62) LinkDotNet.StringBuilder (1.18) - McMaster.NETCore.Plugins (1.4) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0)) + McMaster.NETCore.Plugins (1.4) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) Microsoft.DotNet.PlatformAbstractions (>= 3.1.6) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp2.1)) (&& (== netstandard2.1) (>= netcoreapp2.1)) Microsoft.Extensions.DependencyModel (>= 5.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp2.1)) (&& (== netstandard2.1) (>= netcoreapp2.1)) MessagePack (2.5.108) @@ -170,7 +171,7 @@ NUGET System.Runtime.CompilerServices.Unsafe (>= 6.0) System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net7.0) (< net6.0)) (&& (== net8.0) (< net6.0)) (== netstandard2.0) (== netstandard2.1) MessagePack.Annotations (2.5.108) - Microsoft.Bcl.AsyncInterfaces (7.0) + Microsoft.Bcl.AsyncInterfaces (8.0) System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net462)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462)) Microsoft.Bcl.HashCode (1.1) - restriction: || (&& (== net6.0) (< netcoreapp2.1) (< netstandard2.1)) (&& (== net7.0) (< netcoreapp2.1) (< netstandard2.1)) (&& (== net8.0) (< netcoreapp2.1) (< netstandard2.1)) (== netstandard2.0) Microsoft.Build (17.2) - copy_local: false @@ -274,10 +275,10 @@ NUGET Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0) System.Runtime.CompilerServices.Unsafe (>= 6.0) System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net461)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) - Microsoft.Extensions.DependencyInjection.Abstractions (6.0) - Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net461)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) - System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net461)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) - Microsoft.Extensions.DependencyModel (6.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0)) + Microsoft.Extensions.DependencyInjection.Abstractions (8.0) + Microsoft.Bcl.AsyncInterfaces (>= 8.0) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net462)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462)) + System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net462)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462)) + Microsoft.Extensions.DependencyModel (6.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) System.Buffers (>= 4.5.1) System.Memory (>= 4.5.4) System.Runtime.CompilerServices.Unsafe (>= 6.0) @@ -290,9 +291,8 @@ NUGET Microsoft.Extensions.Logging.Abstractions (>= 6.0) Microsoft.Extensions.Options (>= 6.0) System.Diagnostics.DiagnosticSource (>= 6.0) - Microsoft.Extensions.Logging.Abstractions (6.0.2) - System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< net6.0)) (&& (== net8.0) (>= net461)) (&& (== net8.0) (< net6.0)) (== netstandard2.0) (== netstandard2.1) - System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< net6.0)) (&& (== net8.0) (>= net461)) (&& (== net8.0) (< net6.0)) (== netstandard2.0) (== netstandard2.1) + Microsoft.Extensions.Logging.Abstractions (8.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0) Microsoft.Extensions.Logging.Configuration (6.0) Microsoft.Extensions.Configuration (>= 6.0) Microsoft.Extensions.Configuration.Abstractions (>= 6.0) From f680c583ed30307d1a180064b4fbde3c0e6c67bc Mon Sep 17 00:00:00 2001 From: dawe Date: Fri, 22 Dec 2023 18:42:11 +0100 Subject: [PATCH 02/10] adjust to new analyzers sdk --- src/FsAutoComplete.Core/Commands.fs | 49 ++++++++------- .../LspServers/AdaptiveServerState.fs | 16 +++-- test/OptionAnalyzer/Analyzer.fs | 59 ++++++++++--------- 3 files changed, 73 insertions(+), 51 deletions(-) diff --git a/src/FsAutoComplete.Core/Commands.fs b/src/FsAutoComplete.Core/Commands.fs index 7b1e34125..54f426371 100644 --- a/src/FsAutoComplete.Core/Commands.fs +++ b/src/FsAutoComplete.Core/Commands.fs @@ -1137,14 +1137,23 @@ module Commands = - let analyzerHandler (file: string, content, pt, tast, symbols, getAllEntities) = - let ctx: SDK.Context = + let analyzerHandler + ( + client: SDK.Client, + file: string, + content: ISourceText, + pt, + tast, + _symbols, + _getAllEntities + ) = + let ctx: SDK.EditorContext = { FileName = UMX.untag file - Content = content - ParseTree = pt - TypedTree = tast - Symbols = symbols - GetAllEntities = getAllEntities } + SourceText = content + ParseFileResults = pt + CheckFileResults = None + TypedTree = Some tast + CheckProjectResults = None } let extractResultsFromAnalyzer (r: SDK.AnalysisResult) = match r.Output with @@ -1168,20 +1177,20 @@ module Commands = [] - try - SDK.Client.runAnalyzersSafely ctx - |> List.collect extractResultsFromAnalyzer - |> List.toArray - with ex -> - Loggers.analyzers.error ( - Log.setMessage "Error while processing analyzers for {file}: {message}" - >> Log.addContextDestructured "message" ex.Message - >> Log.addExn ex - >> Log.addContextDestructured "file" file - ) - - [||] + async { + try + let! r = client.RunAnalyzersSafely ctx + return r |> List.collect extractResultsFromAnalyzer |> List.toArray + with ex -> + Loggers.analyzers.error ( + Log.setMessage "Error while processing analyzers for {file}: {message}" + >> Log.addContextDestructured "message" ex.Message + >> Log.addExn ex + >> Log.addContextDestructured "file" file + ) + return [||] + } type Commands() = diff --git a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs index f5d829512..550d603da 100644 --- a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs +++ b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs @@ -127,6 +127,12 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac [| yield! fsiCompilerToolLocations |> Array.map toCompilerToolArgument yield! fsiExtraParameters |] + let analyzersClient = + FSharp.Analyzers.SDK.Client( + Microsoft.Extensions.Logging.Abstractions.NullLogger.Instance, + Set.empty + ) + /// Loads F# Analyzers from the configured directories /// The FSharpConfig /// The RootPath @@ -152,7 +158,7 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac Loggers.analyzers.info (Log.setMessageI $"Loading analyzers from {dir:dir}") - let (dllCount, analyzerCount) = dir |> FSharp.Analyzers.SDK.Client.loadAnalyzers + let (dllCount, analyzerCount) = dir |> analyzersClient.LoadAnalyzers Loggers.analyzers.info ( Log.setMessageI @@ -369,11 +375,12 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac // Since analyzers are not async, we need to switch to a new thread to not block threadpool do! Async.SwitchToNewThread() - let res = + let! res = Commands.analyzerHandler ( + analyzersClient, file, - volatileFile.Source.ToString().Split("\n"), - parseAndCheck.GetParseResults.ParseTree, + volatileFile.Source, + parseAndCheck.GetParseResults, tast, parseAndCheck.GetCheckResults.PartialAssemblySignature.Entities |> Seq.toList, parseAndCheck.GetAllEntities @@ -552,6 +559,7 @@ 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 diff --git a/test/OptionAnalyzer/Analyzer.fs b/test/OptionAnalyzer/Analyzer.fs index e10311ef3..faca8bdb9 100644 --- a/test/OptionAnalyzer/Analyzer.fs +++ b/test/OptionAnalyzer/Analyzer.fs @@ -117,31 +117,36 @@ let info message items = let inline (==>) x y = x, box y -[] -let optionValueAnalyzer: Analyzer = +[] +let optionValueAnalyzer: Analyzer = fun ctx -> - info "analyzing {file} for uses of Option.Value" [ "file" ==> ctx.FileName ] - let state = ResizeArray() - - let handler (range: Range) (m: FSharpMemberOrFunctionOrValue) = - let rangeString = - sprintf "(%d,%d)-(%d,%d)" range.Start.Line range.Start.Column range.End.Line range.End.Column - - let name = String.Join(".", m.DeclaringEntity.Value.FullName, m.DisplayName) - info "checking value at {range} with name {name}" [ "range" ==> rangeString; "name" ==> name ] - - if name = "Microsoft.FSharp.Core.FSharpOption`1.Value" then - info "matched at range {range}" [ "range" ==> rangeString ] - state.Add range - - ctx.TypedTree.Declarations |> List.iter (visitDeclaration handler) - - state - |> Seq.map (fun r -> - { Type = "Option.Value analyzer" - Message = "Option.Value shouldn't be used" - Code = "OV001" - Severity = Warning - Range = r - Fixes = [] }) - |> Seq.toList + async { + info "analyzing {file} for uses of Option.Value" [ "file" ==> ctx.FileName ] + let state = ResizeArray() + + let handler (range: Range) (m: FSharpMemberOrFunctionOrValue) = + let rangeString = + sprintf "(%d,%d)-(%d,%d)" range.Start.Line range.Start.Column range.End.Line range.End.Column + + let name = String.Join(".", m.DeclaringEntity.Value.FullName, m.DisplayName) + info "checking value at {range} with name {name}" [ "range" ==> rangeString; "name" ==> name ] + + if name = "Microsoft.FSharp.Core.FSharpOption`1.Value" then + info "matched at range {range}" [ "range" ==> rangeString ] + state.Add range + + match ctx.TypedTree with + | Some tt -> tt.Declarations |> List.iter (visitDeclaration handler) + | None -> () + + return + state + |> Seq.map (fun r -> + { Type = "Option.Value analyzer" + Message = "Option.Value shouldn't be used" + Code = "OV001" + Severity = Warning + Range = r + Fixes = [] }) + |> Seq.toList + } From 41305973b2efdadf1119b168d845d945c9170a4a Mon Sep 17 00:00:00 2001 From: dawe Date: Tue, 2 Jan 2024 18:46:39 +0100 Subject: [PATCH 03/10] add ExcludeAnalyzers to configuration --- src/FsAutoComplete/LspHelpers.fs | 5 +++++ src/FsAutoComplete/LspHelpers.fsi | 2 ++ src/FsAutoComplete/LspServers/AdaptiveServerState.fs | 12 +++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/FsAutoComplete/LspHelpers.fs b/src/FsAutoComplete/LspHelpers.fs index 7967d56c6..520bc9f4d 100644 --- a/src/FsAutoComplete/LspHelpers.fs +++ b/src/FsAutoComplete/LspHelpers.fs @@ -661,6 +661,7 @@ type FSharpConfigDto = EnableReferenceCodeLens: bool option EnableAnalyzers: bool option AnalyzersPath: string[] option + ExcludeAnalyzers: string[] option DisableInMemoryProjectReferences: bool option LineLens: LineLensConfig option UseSdkScripts: bool option @@ -800,6 +801,7 @@ type FSharpConfig = EnableReferenceCodeLens: bool EnableAnalyzers: bool AnalyzersPath: string[] + ExcludeAnalyzers: string[] DisableInMemoryProjectReferences: bool LineLens: LineLensConfig UseSdkScripts: bool @@ -846,6 +848,7 @@ type FSharpConfig = EnableReferenceCodeLens = false EnableAnalyzers = false AnalyzersPath = [||] + ExcludeAnalyzers = [||] DisableInMemoryProjectReferences = false LineLens = { Enabled = "never"; Prefix = "" } UseSdkScripts = true @@ -894,6 +897,7 @@ type FSharpConfig = EnableReferenceCodeLens = defaultArg dto.EnableReferenceCodeLens false EnableAnalyzers = defaultArg dto.EnableAnalyzers false AnalyzersPath = defaultArg dto.AnalyzersPath [||] + ExcludeAnalyzers = defaultArg dto.ExcludeAnalyzers [||] DisableInMemoryProjectReferences = defaultArg dto.DisableInMemoryProjectReferences false LineLens = { Enabled = defaultArg (dto.LineLens |> Option.map (fun n -> n.Enabled)) "never" @@ -999,6 +1003,7 @@ type FSharpConfig = EnableReferenceCodeLens = defaultArg dto.EnableReferenceCodeLens x.EnableReferenceCodeLens EnableAnalyzers = defaultArg dto.EnableAnalyzers x.EnableAnalyzers AnalyzersPath = defaultArg dto.AnalyzersPath x.AnalyzersPath + ExcludeAnalyzers = defaultArg dto.ExcludeAnalyzers x.ExcludeAnalyzers DisableInMemoryProjectReferences = defaultArg dto.DisableInMemoryProjectReferences x.DisableInMemoryProjectReferences LineLens = diff --git a/src/FsAutoComplete/LspHelpers.fsi b/src/FsAutoComplete/LspHelpers.fsi index adeceb83b..fcbe1439e 100644 --- a/src/FsAutoComplete/LspHelpers.fsi +++ b/src/FsAutoComplete/LspHelpers.fsi @@ -291,6 +291,7 @@ type FSharpConfigDto = EnableReferenceCodeLens: bool option EnableAnalyzers: bool option AnalyzersPath: string[] option + ExcludeAnalyzers: string[] option DisableInMemoryProjectReferences: bool option LineLens: LineLensConfig option UseSdkScripts: bool option @@ -389,6 +390,7 @@ type FSharpConfig = EnableReferenceCodeLens: bool EnableAnalyzers: bool AnalyzersPath: string[] + ExcludeAnalyzers: string[] DisableInMemoryProjectReferences: bool LineLens: LineLensConfig UseSdkScripts: bool diff --git a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs index 550d603da..09969aa20 100644 --- a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs +++ b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs @@ -127,12 +127,21 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac [| yield! fsiCompilerToolLocations |> Array.map toCompilerToolArgument yield! fsiExtraParameters |] - let analyzersClient = + let mutable analyzersClient = FSharp.Analyzers.SDK.Client( Microsoft.Extensions.Logging.Abstractions.NullLogger.Instance, Set.empty ) + let setAnalyzersClient excludeAnalyzers = + let client = + FSharp.Analyzers.SDK.Client( + Microsoft.Extensions.Logging.Abstractions.NullLogger.Instance, + Set.ofArray excludeAnalyzers + ) + + analyzersClient <- client + /// Loads F# Analyzers from the configured directories /// The FSharpConfig /// The RootPath @@ -140,6 +149,7 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac let loadAnalyzers (config: FSharpConfig) (rootPath: string option) = if config.EnableAnalyzers then Loggers.analyzers.info (Log.setMessageI $"Using analyzer roots of {config.AnalyzersPath:roots}") + setAnalyzersClient config.ExcludeAnalyzers // ToDo: add a setter method to the Client to update ExcludeAnalyzers config.AnalyzersPath |> Array.iter (fun analyzerPath -> From 1d6c8f936437b1a9a8340390bbddc213c9d649aa Mon Sep 17 00:00:00 2001 From: dawe Date: Tue, 2 Jan 2024 18:53:49 +0100 Subject: [PATCH 04/10] fix test build --- test/FsAutoComplete.Tests.Lsp/Helpers.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/FsAutoComplete.Tests.Lsp/Helpers.fs b/test/FsAutoComplete.Tests.Lsp/Helpers.fs index 59e32b886..b0ce37f3f 100644 --- a/test/FsAutoComplete.Tests.Lsp/Helpers.fs +++ b/test/FsAutoComplete.Tests.Lsp/Helpers.fs @@ -230,6 +230,7 @@ let defaultConfigDto: FSharpConfigDto = EnableReferenceCodeLens = None EnableAnalyzers = None AnalyzersPath = None + ExcludeAnalyzers = None DisableInMemoryProjectReferences = None AutomaticWorkspaceInit = Some true InterfaceStubGeneration = None From 84862cec13d54eb3142970e8f4832237e781eb47 Mon Sep 17 00:00:00 2001 From: dawe Date: Wed, 3 Jan 2024 16:57:49 +0100 Subject: [PATCH 05/10] support the WIP feature of IncludeAnalyzers filter in the SDK --- src/FsAutoComplete/LspHelpers.fs | 5 ++++ src/FsAutoComplete/LspHelpers.fsi | 2 ++ .../LspServers/AdaptiveServerState.fs | 30 ++++++++++--------- test/FsAutoComplete.Tests.Lsp/Helpers.fs | 1 + 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/FsAutoComplete/LspHelpers.fs b/src/FsAutoComplete/LspHelpers.fs index 520bc9f4d..52505916f 100644 --- a/src/FsAutoComplete/LspHelpers.fs +++ b/src/FsAutoComplete/LspHelpers.fs @@ -662,6 +662,7 @@ type FSharpConfigDto = EnableAnalyzers: bool option AnalyzersPath: string[] option ExcludeAnalyzers: string[] option + IncludeAnalyzers: string[] option DisableInMemoryProjectReferences: bool option LineLens: LineLensConfig option UseSdkScripts: bool option @@ -802,6 +803,7 @@ type FSharpConfig = EnableAnalyzers: bool AnalyzersPath: string[] ExcludeAnalyzers: string[] + IncludeAnalyzers: string[] DisableInMemoryProjectReferences: bool LineLens: LineLensConfig UseSdkScripts: bool @@ -849,6 +851,7 @@ type FSharpConfig = EnableAnalyzers = false AnalyzersPath = [||] ExcludeAnalyzers = [||] + IncludeAnalyzers = [||] DisableInMemoryProjectReferences = false LineLens = { Enabled = "never"; Prefix = "" } UseSdkScripts = true @@ -898,6 +901,7 @@ type FSharpConfig = EnableAnalyzers = defaultArg dto.EnableAnalyzers false AnalyzersPath = defaultArg dto.AnalyzersPath [||] ExcludeAnalyzers = defaultArg dto.ExcludeAnalyzers [||] + IncludeAnalyzers = defaultArg dto.IncludeAnalyzers [||] DisableInMemoryProjectReferences = defaultArg dto.DisableInMemoryProjectReferences false LineLens = { Enabled = defaultArg (dto.LineLens |> Option.map (fun n -> n.Enabled)) "never" @@ -1004,6 +1008,7 @@ type FSharpConfig = EnableAnalyzers = defaultArg dto.EnableAnalyzers x.EnableAnalyzers AnalyzersPath = defaultArg dto.AnalyzersPath x.AnalyzersPath ExcludeAnalyzers = defaultArg dto.ExcludeAnalyzers x.ExcludeAnalyzers + IncludeAnalyzers = defaultArg dto.IncludeAnalyzers x.IncludeAnalyzers DisableInMemoryProjectReferences = defaultArg dto.DisableInMemoryProjectReferences x.DisableInMemoryProjectReferences LineLens = diff --git a/src/FsAutoComplete/LspHelpers.fsi b/src/FsAutoComplete/LspHelpers.fsi index fcbe1439e..989c06308 100644 --- a/src/FsAutoComplete/LspHelpers.fsi +++ b/src/FsAutoComplete/LspHelpers.fsi @@ -292,6 +292,7 @@ type FSharpConfigDto = EnableAnalyzers: bool option AnalyzersPath: string[] option ExcludeAnalyzers: string[] option + IncludeAnalyzers: string[] option DisableInMemoryProjectReferences: bool option LineLens: LineLensConfig option UseSdkScripts: bool option @@ -391,6 +392,7 @@ type FSharpConfig = EnableAnalyzers: bool AnalyzersPath: string[] ExcludeAnalyzers: string[] + IncludeAnalyzers: string[] DisableInMemoryProjectReferences: bool LineLens: LineLensConfig UseSdkScripts: bool diff --git a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs index 09969aa20..69808deb3 100644 --- a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs +++ b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs @@ -127,21 +127,11 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac [| yield! fsiCompilerToolLocations |> Array.map toCompilerToolArgument yield! fsiExtraParameters |] - let mutable analyzersClient = + let analyzersClient = FSharp.Analyzers.SDK.Client( - Microsoft.Extensions.Logging.Abstractions.NullLogger.Instance, - Set.empty + Microsoft.Extensions.Logging.Abstractions.NullLogger.Instance ) - let setAnalyzersClient excludeAnalyzers = - let client = - FSharp.Analyzers.SDK.Client( - Microsoft.Extensions.Logging.Abstractions.NullLogger.Instance, - Set.ofArray excludeAnalyzers - ) - - analyzersClient <- client - /// Loads F# Analyzers from the configured directories /// The FSharpConfig /// The RootPath @@ -149,7 +139,19 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac let loadAnalyzers (config: FSharpConfig) (rootPath: string option) = if config.EnableAnalyzers then Loggers.analyzers.info (Log.setMessageI $"Using analyzer roots of {config.AnalyzersPath:roots}") - setAnalyzersClient config.ExcludeAnalyzers // ToDo: add a setter method to the Client to update ExcludeAnalyzers + + let excludeInclude = + match config.ExcludeAnalyzers, config.IncludeAnalyzers with + | [||], [||] -> None + | e, [||] -> Some(FSharp.Analyzers.SDK.ExcludeInclude.Exclude(Set.ofArray e)) + | [||], i -> Some(FSharp.Analyzers.SDK.ExcludeInclude.Include(Set.ofArray i)) + | i, _e -> + Loggers.analyzers.warn ( + Log.setMessage + "--exclude-analyzers and --include-analyzers are mutually exclusive, ignoring --exclude-analyzers" + ) + + Some(FSharp.Analyzers.SDK.ExcludeInclude.Include(Set.ofArray i)) config.AnalyzersPath |> Array.iter (fun analyzerPath -> @@ -168,7 +170,7 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac Loggers.analyzers.info (Log.setMessageI $"Loading analyzers from {dir:dir}") - let (dllCount, analyzerCount) = dir |> analyzersClient.LoadAnalyzers + let (dllCount, analyzerCount) = analyzersClient.LoadAnalyzers(dir, excludeInclude) Loggers.analyzers.info ( Log.setMessageI diff --git a/test/FsAutoComplete.Tests.Lsp/Helpers.fs b/test/FsAutoComplete.Tests.Lsp/Helpers.fs index b0ce37f3f..2b0ee4c6b 100644 --- a/test/FsAutoComplete.Tests.Lsp/Helpers.fs +++ b/test/FsAutoComplete.Tests.Lsp/Helpers.fs @@ -231,6 +231,7 @@ let defaultConfigDto: FSharpConfigDto = EnableAnalyzers = None AnalyzersPath = None ExcludeAnalyzers = None + IncludeAnalyzers = None DisableInMemoryProjectReferences = None AutomaticWorkspaceInit = Some true InterfaceStubGeneration = None From 322b1024d31cd8fa7ad36e49be14c41febe6cf07 Mon Sep 17 00:00:00 2001 From: dawe Date: Wed, 3 Jan 2024 17:45:45 +0100 Subject: [PATCH 06/10] adjust --- src/FsAutoComplete/LspServers/AdaptiveServerState.fs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs index 69808deb3..298750d74 100644 --- a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs +++ b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs @@ -142,16 +142,15 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac let excludeInclude = match config.ExcludeAnalyzers, config.IncludeAnalyzers with - | [||], [||] -> None - | e, [||] -> Some(FSharp.Analyzers.SDK.ExcludeInclude.Exclude(Set.ofArray e)) - | [||], i -> Some(FSharp.Analyzers.SDK.ExcludeInclude.Include(Set.ofArray i)) + | e, [||] -> FSharp.Analyzers.SDK.ExcludeInclude.Exclude(Set.ofArray e) + | [||], i -> FSharp.Analyzers.SDK.ExcludeInclude.Include(Set.ofArray i) | i, _e -> Loggers.analyzers.warn ( Log.setMessage "--exclude-analyzers and --include-analyzers are mutually exclusive, ignoring --exclude-analyzers" ) - Some(FSharp.Analyzers.SDK.ExcludeInclude.Include(Set.ofArray i)) + FSharp.Analyzers.SDK.ExcludeInclude.Include(Set.ofArray i) config.AnalyzersPath |> Array.iter (fun analyzerPath -> From 056a75add3c551f9d7dac9f6f5113066daeea4e0 Mon Sep 17 00:00:00 2001 From: dawe Date: Fri, 5 Jan 2024 11:07:11 +0100 Subject: [PATCH 07/10] adjust to analyzer filter predicate --- src/FsAutoComplete/LspServers/AdaptiveServerState.fs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs index 298750d74..502fef114 100644 --- a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs +++ b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs @@ -142,15 +142,15 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac let excludeInclude = match config.ExcludeAnalyzers, config.IncludeAnalyzers with - | e, [||] -> FSharp.Analyzers.SDK.ExcludeInclude.Exclude(Set.ofArray e) - | [||], i -> FSharp.Analyzers.SDK.ExcludeInclude.Include(Set.ofArray i) - | i, _e -> + | e, [||] -> FSharp.Analyzers.SDK.ExcludeInclude.ExcludeFilter(fun (s: string) -> Array.contains s e) + | [||], i -> FSharp.Analyzers.SDK.ExcludeInclude.IncludeFilter(fun (s: string) -> Array.contains s i) + | _e, i -> Loggers.analyzers.warn ( Log.setMessage "--exclude-analyzers and --include-analyzers are mutually exclusive, ignoring --exclude-analyzers" ) - FSharp.Analyzers.SDK.ExcludeInclude.Include(Set.ofArray i) + FSharp.Analyzers.SDK.ExcludeInclude.IncludeFilter(fun (s: string) -> Array.contains s i) config.AnalyzersPath |> Array.iter (fun analyzerPath -> From 5110c539980ef7bdb4c9a9661c24596edffabdb6 Mon Sep 17 00:00:00 2001 From: dawe Date: Fri, 5 Jan 2024 17:04:51 +0100 Subject: [PATCH 08/10] bump the analyzers sdk dependency --- paket.dependencies | 2 +- paket.lock | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/paket.dependencies b/paket.dependencies index 9e40852a1..ebcb391e1 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.22.0 +nuget FSharp.Analyzers.SDK 0.23.0 nuget ICSharpCode.Decompiler nuget Mono.Cecil >= 0.11.4 nuget FSharpLint.Core diff --git a/paket.lock b/paket.lock index 6acdb0680..dada01e3e 100644 --- a/paket.lock +++ b/paket.lock @@ -57,11 +57,11 @@ NUGET FSharp.Core (>= 4.3.4) FSharp.Analyzers.Build (0.2) NETStandard.Library (>= 1.6.1) - FSharp.Analyzers.SDK (0.22) + FSharp.Analyzers.SDK (0.23) 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)) - Microsoft.Extensions.Logging.Abstractions (>= 8.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Microsoft.Extensions.Logging.Abstractions (>= 6.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) FSharp.Compiler.Service (43.8.100) FSharp.Core (8.0.100) System.Buffers (>= 4.5.1) @@ -171,7 +171,7 @@ NUGET System.Runtime.CompilerServices.Unsafe (>= 6.0) System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net7.0) (< net6.0)) (&& (== net8.0) (< net6.0)) (== netstandard2.0) (== netstandard2.1) MessagePack.Annotations (2.5.108) - Microsoft.Bcl.AsyncInterfaces (8.0) + Microsoft.Bcl.AsyncInterfaces (7.0) System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net462)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462)) Microsoft.Bcl.HashCode (1.1) - restriction: || (&& (== net6.0) (< netcoreapp2.1) (< netstandard2.1)) (&& (== net7.0) (< netcoreapp2.1) (< netstandard2.1)) (&& (== net8.0) (< netcoreapp2.1) (< netstandard2.1)) (== netstandard2.0) Microsoft.Build (17.2) - copy_local: false @@ -275,9 +275,9 @@ NUGET Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0) System.Runtime.CompilerServices.Unsafe (>= 6.0) System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net461)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) - Microsoft.Extensions.DependencyInjection.Abstractions (8.0) - Microsoft.Bcl.AsyncInterfaces (>= 8.0) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net462)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462)) - System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net462)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net462)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net462)) + Microsoft.Extensions.DependencyInjection.Abstractions (6.0) + Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net461)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) + System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net461)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) Microsoft.Extensions.DependencyModel (6.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) System.Buffers (>= 4.5.1) System.Memory (>= 4.5.4) @@ -291,8 +291,7 @@ NUGET Microsoft.Extensions.Logging.Abstractions (>= 6.0) Microsoft.Extensions.Options (>= 6.0) System.Diagnostics.DiagnosticSource (>= 6.0) - Microsoft.Extensions.Logging.Abstractions (8.0) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0) + Microsoft.Extensions.Logging.Abstractions (6.0.2) Microsoft.Extensions.Logging.Configuration (6.0) Microsoft.Extensions.Configuration (>= 6.0) Microsoft.Extensions.Configuration.Abstractions (>= 6.0) From 937ec45b4049af64e08b4ebcf5135684bedc4900 Mon Sep 17 00:00:00 2001 From: dawe Date: Mon, 8 Jan 2024 16:16:26 +0100 Subject: [PATCH 09/10] put the CheckFileResults into the EditorContext for the analyzers --- src/FsAutoComplete.Core/Commands.fs | 5 ++--- src/FsAutoComplete/LspServers/AdaptiveServerState.fs | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/FsAutoComplete.Core/Commands.fs b/src/FsAutoComplete.Core/Commands.fs index 54f426371..580599657 100644 --- a/src/FsAutoComplete.Core/Commands.fs +++ b/src/FsAutoComplete.Core/Commands.fs @@ -1144,14 +1144,13 @@ module Commands = content: ISourceText, pt, tast, - _symbols, - _getAllEntities + checkFileResults: FSharpCheckFileResults ) = let ctx: SDK.EditorContext = { FileName = UMX.untag file SourceText = content ParseFileResults = pt - CheckFileResults = None + CheckFileResults = Some checkFileResults TypedTree = Some tast CheckProjectResults = None } diff --git a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs index 502fef114..3ca9764bf 100644 --- a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs +++ b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs @@ -393,8 +393,7 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac volatileFile.Source, parseAndCheck.GetParseResults, tast, - parseAndCheck.GetCheckResults.PartialAssemblySignature.Entities |> Seq.toList, - parseAndCheck.GetAllEntities + parseAndCheck.GetCheckResults ) let! ct = Async.CancellationToken From 8bef0e514fb64f3660f51f6be6e968163cfd6544 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 11 Jan 2024 10:40:10 +0100 Subject: [PATCH 10/10] settle on "'t array" in FSharpConfigDto and FSharpConfig --- src/FsAutoComplete/LspHelpers.fs | 24 ++++++++++++------------ src/FsAutoComplete/LspHelpers.fsi | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/FsAutoComplete/LspHelpers.fs b/src/FsAutoComplete/LspHelpers.fs index 52505916f..c72b6b6de 100644 --- a/src/FsAutoComplete/LspHelpers.fs +++ b/src/FsAutoComplete/LspHelpers.fs @@ -636,7 +636,7 @@ type FSACDto = type FSharpConfigDto = { AutomaticWorkspaceInit: bool option WorkspaceModePeekDeepLevel: int option - ExcludeProjectDirectories: string[] option + ExcludeProjectDirectories: string array option KeywordsAutocomplete: bool option ExternalAutocomplete: bool option FullNameExternalAutocomplete: bool option @@ -660,15 +660,15 @@ type FSharpConfigDto = ResolveNamespaces: bool option EnableReferenceCodeLens: bool option EnableAnalyzers: bool option - AnalyzersPath: string[] option - ExcludeAnalyzers: string[] option - IncludeAnalyzers: string[] option + AnalyzersPath: string array option + ExcludeAnalyzers: string array option + IncludeAnalyzers: string array option DisableInMemoryProjectReferences: bool option LineLens: LineLensConfig option UseSdkScripts: bool option DotNetRoot: string option - FSIExtraParameters: string[] option - FSICompilerToolLocations: string[] option + FSIExtraParameters: string array option + FSICompilerToolLocations: string array option TooltipMode: string option GenerateBinlog: bool option AbstractClassStubGeneration: bool option @@ -774,7 +774,7 @@ let tryCreateRegex (pattern: string) = type FSharpConfig = { AutomaticWorkspaceInit: bool WorkspaceModePeekDeepLevel: int - ExcludeProjectDirectories: string[] + ExcludeProjectDirectories: string array KeywordsAutocomplete: bool ExternalAutocomplete: bool FullNameExternalAutocomplete: bool @@ -801,15 +801,15 @@ type FSharpConfig = ResolveNamespaces: bool EnableReferenceCodeLens: bool EnableAnalyzers: bool - AnalyzersPath: string[] - ExcludeAnalyzers: string[] - IncludeAnalyzers: string[] + AnalyzersPath: string array + ExcludeAnalyzers: string array + IncludeAnalyzers: string array DisableInMemoryProjectReferences: bool LineLens: LineLensConfig UseSdkScripts: bool DotNetRoot: string - FSIExtraParameters: string[] - FSICompilerToolLocations: string[] + FSIExtraParameters: string array + FSICompilerToolLocations: string array TooltipMode: string GenerateBinlog: bool CodeLenses: CodeLensConfig diff --git a/src/FsAutoComplete/LspHelpers.fsi b/src/FsAutoComplete/LspHelpers.fsi index 989c06308..e6bd689ab 100644 --- a/src/FsAutoComplete/LspHelpers.fsi +++ b/src/FsAutoComplete/LspHelpers.fsi @@ -266,7 +266,7 @@ type FSACDto = type FSharpConfigDto = { AutomaticWorkspaceInit: bool option WorkspaceModePeekDeepLevel: int option - ExcludeProjectDirectories: string[] option + ExcludeProjectDirectories: string array option KeywordsAutocomplete: bool option ExternalAutocomplete: bool option FullNameExternalAutocomplete: bool option @@ -290,15 +290,15 @@ type FSharpConfigDto = ResolveNamespaces: bool option EnableReferenceCodeLens: bool option EnableAnalyzers: bool option - AnalyzersPath: string[] option - ExcludeAnalyzers: string[] option - IncludeAnalyzers: string[] option + AnalyzersPath: string array option + ExcludeAnalyzers: string array option + IncludeAnalyzers: string array option DisableInMemoryProjectReferences: bool option LineLens: LineLensConfig option UseSdkScripts: bool option DotNetRoot: string option - FSIExtraParameters: string[] option - FSICompilerToolLocations: string[] option + FSIExtraParameters: string array option + FSICompilerToolLocations: string array option TooltipMode: string option GenerateBinlog: bool option AbstractClassStubGeneration: bool option @@ -363,7 +363,7 @@ type DebugConfig = type FSharpConfig = { AutomaticWorkspaceInit: bool WorkspaceModePeekDeepLevel: int - ExcludeProjectDirectories: string[] + ExcludeProjectDirectories: string array KeywordsAutocomplete: bool ExternalAutocomplete: bool FullNameExternalAutocomplete: bool @@ -390,15 +390,15 @@ type FSharpConfig = ResolveNamespaces: bool EnableReferenceCodeLens: bool EnableAnalyzers: bool - AnalyzersPath: string[] - ExcludeAnalyzers: string[] - IncludeAnalyzers: string[] + AnalyzersPath: string array + ExcludeAnalyzers: string array + IncludeAnalyzers: string array DisableInMemoryProjectReferences: bool LineLens: LineLensConfig UseSdkScripts: bool DotNetRoot: string - FSIExtraParameters: string[] - FSICompilerToolLocations: string[] + FSIExtraParameters: string array + FSICompilerToolLocations: string array TooltipMode: string GenerateBinlog: bool CodeLenses: CodeLensConfig