Skip to content

Commit

Permalink
keep bumping FCS - disable analyzers SDK because it has a strict depe…
Browse files Browse the repository at this point in the history
…ndency
  • Loading branch information
baronfel committed Mar 17, 2024
1 parent 637725c commit 700d4a0
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 188 deletions.
2 changes: 1 addition & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -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.25.0
# nuget FSharp.Analyzers.SDK # disabled because it conflicts with the floating FCS dependency
nuget ICSharpCode.Decompiler
nuget Mono.Cecil >= 0.11.4
nuget FSharpLint.Core
Expand Down
37 changes: 12 additions & 25 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,22 @@ 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.25)
FSharp.Compiler.Service (43.8.200) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
FSharp.Core (8.0.200) - 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 (>= 6.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
FSharp.Compiler.Service (43.8.300-preview.24154.4)
FSharp.Core (8.0.300-beta.24154.4)
System.Buffers (>= 4.5.1)
System.Collections.Immutable (>= 7.0)
System.Diagnostics.DiagnosticSource (>= 7.0.2)
System.Memory (>= 4.5.5)
System.Reflection.Emit (>= 4.7)
System.Reflection.Metadata (>= 7.0)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
FSharp.Control.AsyncSeq (3.2.1)
FSharp.Core (>= 4.7.2)
Microsoft.Bcl.AsyncInterfaces (>= 5.0)
FSharp.Control.Reactive (5.0.5) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
FSharp.Core (>= 4.7.2)
System.Reactive (>= 5.0 < 6.0)
FSharp.Core (8.0.300-beta.24154.4)
FSharp.Data.Adaptive (1.2.13)
FSharp.Core (>= 4.7)
System.Reflection.Emit.Lightweight (>= 4.6)
Expand Down Expand Up @@ -147,9 +152,6 @@ 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.63)
LinkDotNet.StringBuilder (1.18)
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)
MessagePack.Annotations (>= 2.5.108)
Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net7.0) (< net6.0)) (&& (== net8.0) (< net6.0)) (== netstandard2.0) (== netstandard2.1)
Expand Down Expand Up @@ -267,12 +269,6 @@ 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)) (&& (== 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)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Text.Encodings.Web (>= 6.0)
System.Text.Json (>= 6.0)
Microsoft.Extensions.Logging (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))
Microsoft.Extensions.DependencyInjection (>= 6.0)
Expand All @@ -281,6 +277,8 @@ NUGET
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.Configuration (6.0)
Microsoft.Extensions.Configuration (>= 6.0)
Microsoft.Extensions.Configuration.Abstractions (>= 6.0)
Expand Down Expand Up @@ -760,17 +758,6 @@ NUGET
Expecto (>= 10.0 < 11.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
FSharp.Core (>= 7.0.200) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
System.Collections.Immutable (>= 6.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
remote: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json
FSharp.Compiler.Service (43.8.300-preview.24080.5)
FSharp.Core (8.0.300-beta.24080.5)
System.Buffers (>= 4.5.1)
System.Collections.Immutable (>= 7.0)
System.Diagnostics.DiagnosticSource (>= 7.0.2)
System.Memory (>= 4.5.5)
System.Reflection.Emit (>= 4.7)
System.Reflection.Metadata (>= 7.0)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
FSharp.Core (8.0.300-beta.24080.5)

GROUP Build
STORAGE: NONE
Expand Down
110 changes: 55 additions & 55 deletions src/FsAutoComplete.Core/Commands.fs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ open FSharp.Compiler.Text
open Ionide.ProjInfo
open Ionide.ProjInfo.ProjectSystem
open FsToolkit.ErrorHandling
open FSharp.Analyzers
// open FSharp.Analyzers
open FSharp.UMX
open FSharp.Compiler.Tokenization
open SymbolLocation
Expand Down Expand Up @@ -75,7 +75,7 @@ module AsyncResult =
type NotificationEvent =
| ParseError of errors: FSharpDiagnostic[] * file: string<LocalPath> * version: int
| Workspace of ProjectSystem.ProjectResponse
| AnalyzerMessage of messages: FSharp.Analyzers.SDK.Message[] * file: string<LocalPath> * version: int
// | AnalyzerMessage of messages: FSharp.Analyzers.SDK.Message[] * file: string<LocalPath> * version: int
| UnusedOpens of file: string<LocalPath> * opens: Range[] * version: int
// | Lint of file: string<LocalPath> * warningsWithCodes: Lint.EnrichedLintWarning list
| UnusedDeclarations of file: string<LocalPath> * decls: range[] * version: int
Expand Down Expand Up @@ -1138,59 +1138,59 @@ module Commands =



let analyzerHandler
(
client: SDK.Client<SDK.EditorAnalyzerAttribute, SDK.EditorContext>,
file: string<LocalPath>,
content: ISourceText,
pt,
tast,
checkFileResults: FSharpCheckFileResults
) =
let ctx: SDK.EditorContext =
{ FileName = UMX.untag file
SourceText = content
ParseFileResults = pt
CheckFileResults = Some checkFileResults
TypedTree = Some tast
CheckProjectResults = None }

let extractResultsFromAnalyzer (r: SDK.AnalysisResult) =
match r.Output with
| Ok results ->
Loggers.analyzers.info (
Log.setMessage "Analyzer {analyzer} returned {count} diagnostics for file {file}"
>> Log.addContextDestructured "analyzer" r.AnalyzerName
>> Log.addContextDestructured "count" results.Length
>> Log.addContextDestructured "file" (UMX.untag file)
)

results
| Error e ->
Loggers.analyzers.error (
Log.setMessage "Analyzer {analyzer} errored while processing {file}: {message}"
>> Log.addContextDestructured "analyzer" r.AnalyzerName
>> Log.addContextDestructured "file" (UMX.untag file)
>> Log.addContextDestructured "message" e.Message
>> Log.addExn e
)

[]

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 [||]
}
// let analyzerHandler
// (
// client: SDK.Client<SDK.EditorAnalyzerAttribute, SDK.EditorContext>,
// file: string<LocalPath>,
// content: ISourceText,
// pt,
// tast,
// checkFileResults: FSharpCheckFileResults
// ) =
// let ctx: SDK.EditorContext =
// { FileName = UMX.untag file
// SourceText = content
// ParseFileResults = pt
// CheckFileResults = Some checkFileResults
// TypedTree = Some tast
// CheckProjectResults = None }

// let extractResultsFromAnalyzer (r: SDK.AnalysisResult) =
// match r.Output with
// | Ok results ->
// Loggers.analyzers.info (
// Log.setMessage "Analyzer {analyzer} returned {count} diagnostics for file {file}"
// >> Log.addContextDestructured "analyzer" r.AnalyzerName
// >> Log.addContextDestructured "count" results.Length
// >> Log.addContextDestructured "file" (UMX.untag file)
// )

// results
// | Error e ->
// Loggers.analyzers.error (
// Log.setMessage "Analyzer {analyzer} errored while processing {file}: {message}"
// >> Log.addContextDestructured "analyzer" r.AnalyzerName
// >> Log.addContextDestructured "file" (UMX.untag file)
// >> Log.addContextDestructured "message" e.Message
// >> Log.addExn e
// )

// []

// 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() =

Expand Down
2 changes: 1 addition & 1 deletion src/FsAutoComplete.Core/paket.references
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FSharp.Analyzers.SDK
#FSharp.Analyzers.SDK
ICSharpCode.Decompiler
Microsoft.SourceLink.GitHub
FSharp.UMX
Expand Down
Loading

0 comments on commit 700d4a0

Please sign in to comment.