diff --git a/paket.lock b/paket.lock index 91ba0bff7..22d5649de 100644 --- a/paket.lock +++ b/paket.lock @@ -55,10 +55,10 @@ NUGET StreamJsonRpc (>= 2.8.28) FParsec (1.1.1) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0)) FSharp.Core (>= 4.3.4) - FSharp.Analyzers.SDK (0.11) - FSharp.Compiler.Service (>= 41.0.1) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0)) - FSharp.Core (>= 6.0.1) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0)) - McMaster.NETCore.Plugins (>= 1.4) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0)) + FSharp.Analyzers.SDK (0.13) + FSharp.Compiler.Service (>= 43.7.400) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + FSharp.Core (>= 7.0.400) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + McMaster.NETCore.Plugins (>= 1.4) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) FSharp.Compiler.Service (43.7.400) FSharp.Core (7.0.400) System.Buffers (>= 4.5.1) @@ -154,7 +154,7 @@ NUGET Newtonsoft.Json (>= 13.0.1) - restriction: || (== net6.0) (== net7.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) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0)) + McMaster.NETCore.Plugins (1.4) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) Microsoft.DotNet.PlatformAbstractions (>= 3.1.6) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= netcoreapp2.1)) (&& (== netstandard2.1) (>= netcoreapp2.1)) Microsoft.Extensions.DependencyModel (>= 5.0) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= netcoreapp2.1)) (&& (== netstandard2.1) (>= netcoreapp2.1)) MessagePack (2.4.35) @@ -273,7 +273,7 @@ NUGET 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)) (== 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)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) - Microsoft.Extensions.DependencyModel (6.0) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0)) + Microsoft.Extensions.DependencyModel (6.0) - restriction: || (== net6.0) (== net7.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) diff --git a/src/FsAutoComplete.Core/Commands.fs b/src/FsAutoComplete.Core/Commands.fs index 3fd723e8e..e90a39212 100644 --- a/src/FsAutoComplete.Core/Commands.fs +++ b/src/FsAutoComplete.Core/Commands.fs @@ -1147,14 +1147,17 @@ module Commands = - let analyzerHandler (file: string, content, pt, tast, symbols, getAllEnts) = + let analyzerHandler (file: string, content, parseAndCheck: ParseAndCheckResults, tast) = let ctx: SDK.Context = { FileName = UMX.untag file Content = content - ParseTree = pt TypedTree = tast - Symbols = symbols - GetAllEntities = getAllEnts } + GetAllEntities = parseAndCheck.GetAllEntities + ParseFileResults = parseAndCheck.GetParseResults + CheckFileResults = parseAndCheck.GetCheckResults + CheckProjectResults = Unchecked.defaultof + AllSymbolUses = Array.empty + SymbolUsesOfFile = parseAndCheck.GetCheckResults.GetAllUsesOfAllSymbolsInFile() |> Seq.toArray } let extractResultsFromAnalyzer (r: SDK.AnalysisResult) = match r.Output with @@ -1292,14 +1295,7 @@ type Commands | true, fileData -> let res = - Commands.analyzerHandler ( - file, - fileData.Source.ToString().Split("\n"), - parseAndCheck.GetParseResults.ParseTree, - tast, - parseAndCheck.GetCheckResults.PartialAssemblySignature.Entities |> Seq.toList, - parseAndCheck.GetAllEntities - ) + Commands.analyzerHandler (file, fileData.Source.ToString().Split("\n"), parseAndCheck, tast) (res, file) |> NotificationEvent.AnalyzerMessage |> notify.Trigger diff --git a/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs b/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs index 49cd59c15..a8de9cb3e 100644 --- a/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs +++ b/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs @@ -163,7 +163,9 @@ type AdaptiveFSharpLspServer Loggers.analyzers.info (Log.setMessageI $"Loading analyzers from {dir:dir}") - let (dllCount, analyzerCount) = dir |> FSharp.Analyzers.SDK.Client.loadAnalyzers + let dllCount, analyzerCount = + dir + |> FSharp.Analyzers.SDK.Client.loadAnalyzers (fun error -> Loggers.analyzers.error (Log.setMessage error)) Loggers.analyzers.info ( Log.setMessageI @@ -391,14 +393,7 @@ type AdaptiveFSharpLspServer do! Async.SwitchToNewThread() let res = - Commands.analyzerHandler ( - file, - volatileFile.Source.ToString().Split("\n"), - parseAndCheck.GetParseResults.ParseTree, - tast, - parseAndCheck.GetCheckResults.PartialAssemblySignature.Entities |> Seq.toList, - parseAndCheck.GetAllEntities - ) + Commands.analyzerHandler (file, volatileFile.Source.ToString().Split("\n"), parseAndCheck, tast) let! ct = Async.CancellationToken notifications.Trigger(NotificationEvent.AnalyzerMessage(res, file), ct) diff --git a/src/FsAutoComplete/LspServers/FsAutoComplete.Lsp.fs b/src/FsAutoComplete/LspServers/FsAutoComplete.Lsp.fs index b11db9eee..c95cbe095 100644 --- a/src/FsAutoComplete/LspServers/FsAutoComplete.Lsp.fs +++ b/src/FsAutoComplete/LspServers/FsAutoComplete.Lsp.fs @@ -466,7 +466,9 @@ type FSharpLspServer(state: State, lspClient: FSharpLspClient, sourceTextFactory >> Log.addContextDestructured "dir" dir ) - let (n, m) = dir |> SDK.Client.loadAnalyzers + let n, m = + dir + |> SDK.Client.loadAnalyzers (fun error -> Loggers.analyzers.error (Log.setMessage error)) Loggers.analyzers.info ( Log.setMessage "From {name}: {dllNo} dlls including {analyzersNo} analyzers"