Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"rollForward": false
},
"fantomas": {
"version": "7.0.1",
"version": "7.0.3",
"commands": [
"fantomas"
],
"rollForward": false
},
"fsharp-analyzers": {
"version": "0.32.1",
"version": "0.33.0",
"commands": [
"fsharp-analyzers"
],
Expand All @@ -38,4 +38,4 @@
"rollForward": false
}
}
}
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"failtest",
"Fantomas",
"fantomasignore",
"Finalizer",
"foldi",
"FSAC",
"fsautocomplete",
Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
<WarnOn Condition="'$(Configuration)' != 'Debug'">$(WarnOn);1182</WarnOn> <!-- Unused
variables,https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/compiler-options#opt-in-warnings -->
<NoWarn>$(NoWarn);FS0044</NoWarn> <!-- Ignore deprecations -->
<NoWarn>$(NoWarn);FS3397</NoWarn> <!-- This expression uses unit for an obj-typed argument. This will lead to passing null at runtime -->
<WarnOn>$(WarnOn);3390</WarnOn><!-- Malformed XML doc comments -->

<!-- Package Reference with no usable assets -->
<NoWarn>$(NoWarn);NU1701</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
12 changes: 6 additions & 6 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ storage: none
nuget BenchmarkDotNet
nuget Fantomas.Client >= 0.9
nuget FSharp.Compiler.Service >= 43.9.300
nuget Ionide.Analyzers 0.14.7
nuget Ionide.Analyzers 0.14.9
nuget FSharp.Analyzers.Build
nuget Ionide.ProjInfo >= 0.71.2
nuget Ionide.ProjInfo.FCS >= 0.71.2
nuget Ionide.ProjInfo.ProjectSystem >= 0.71.2
nuget Ionide.ProjInfo >= 0.72.0
nuget Ionide.ProjInfo.FCS >= 0.72.0
nuget Ionide.ProjInfo.ProjectSystem >= 0.72.0
nuget Microsoft.Build >= 17.2 copy_local:false
nuget Microsoft.Build.Framework >= 17.4 copy_local:false
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
nuget FSharp.Analyzers.SDK 0.32.1
nuget FSharp.Analyzers.SDK 0.33.1
nuget ICSharpCode.Decompiler
nuget Mono.Cecil >= 0.11.4
nuget FSharpLint.Core
Expand Down Expand Up @@ -63,4 +63,4 @@ nuget System.Text.RegularExpressions

## Test Explorer
nuget Microsoft.TestPlatform.TranslationLayer
nuget Microsoft.TestPlatform.ObjectModel
nuget Microsoft.TestPlatform.ObjectModel
14 changes: 7 additions & 7 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ NUGET
FParsec (1.1.1) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0))
FSharp.Core (>= 4.3.4)
FSharp.Analyzers.Build (0.3)
FSharp.Analyzers.SDK (0.32.1)
FSharp.Analyzers.SDK (0.33.1)
FSharp.Compiler.Service (43.9.300) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
FSharp.Core (9.0.300) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
McMaster.NETCore.Plugins (>= 1.4) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
Expand Down Expand Up @@ -124,23 +124,23 @@ NUGET
ICSharpCode.Decompiler (8.2.0.7535)
System.Collections.Immutable (>= 6.0)
System.Reflection.Metadata (>= 6.0)
Ionide.Analyzers (0.14.7)
Ionide.Analyzers (0.14.9)
Ionide.KeepAChangelog.Tasks (0.1.8) - copy_local: true
Ionide.LanguageServerProtocol (0.7)
FSharp.Core (>= 6.0)
Newtonsoft.Json (>= 13.0.1)
StreamJsonRpc (>= 2.16.36)
Ionide.ProjInfo (0.71.2)
Ionide.ProjInfo (0.72)
FSharp.Core (>= 6.0) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
Microsoft.VisualStudio.SolutionPersistence (>= 1.0.28) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
SemanticVersioning (>= 2.0.2) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
Ionide.ProjInfo.FCS (0.71.2)
Ionide.ProjInfo.FCS (0.72)
FSharp.Compiler.Service (>= 43.9.300) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
FSharp.Core (>= 9.0.300) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
Ionide.ProjInfo (>= 0.71.2) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
Ionide.ProjInfo.ProjectSystem (0.71.2)
Ionide.ProjInfo (>= 0.72) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
Ionide.ProjInfo.ProjectSystem (0.72)
Fsharp.Control.Reactive (>= 5.0.5) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
Ionide.ProjInfo.FCS (>= 0.71.2) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
Ionide.ProjInfo.FCS (>= 0.72) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
Newtonsoft.Json (>= 13.0.3) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
LinkDotNet.StringBuilder (1.18)
McMaster.NETCore.Plugins (1.4) - restriction: || (== net8.0) (== net9.0) (&& (== netstandard2.0) (>= net8.0)) (&& (== netstandard2.1) (>= net8.0))
Expand Down
49 changes: 49 additions & 0 deletions src/FsAutoComplete.Core/AdaptiveExtensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -937,3 +937,52 @@ module AdaptiveFile =
()

AdaptiveFile.GetLastWriteTimeUtc path


[<AutoOpen>]
module AsyncAValExtensions =
type asyncaval<'T> with
/// Adds a disposable callback to the aval that will be executed whenever the
/// avals value changed.
member value.AddCallback(weak: bool, action: 'T -> Async<unit>) : IDisposable =

let last = ref ValueNone

let sub =
let cb =
if weak then
value.AddWeakMarkingCallback
else
value.AddMarkingCallback

cb (fun () ->
let t = Transaction.Running.Value

t.AddFinalizer(fun () ->
async {
let! v = AsyncAVal.forceAsync value

match last.Value with
| ValueSome o when DefaultEquality.equals o v -> ()
| _ ->
last.Value <- ValueSome v
do! action v
}
|> Async.StartImmediate))

match Transaction.Running with
| ValueSome t ->
t.AddFinalizer(fun () ->
async {
let! v = value |> AsyncAVal.forceAsync
do! action v
}
|> Async.StartImmediate)
| ValueNone ->
async {
let! v = value |> AsyncAVal.forceAsync
do! action v
}
|> Async.StartImmediate

sub
10 changes: 10 additions & 0 deletions src/FsAutoComplete.Core/AdaptiveExtensions.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -418,3 +418,13 @@ module AdaptiveFile =
/// This will create the directory.
/// </summary>
val getLastWriteTimeUtcEnsureDir: path: string -> aval<DateTime>

[<AutoOpen>]
module AsyncAValExtensions =
type asyncaval<'T> with

/// <summary>
/// Adds a disposable callback to the aval that will be executed whenever the
/// avals value changed.
/// </summary>
member AddCallback: weak: bool * action: ('T -> Async<unit>) -> System.IDisposable
9 changes: 6 additions & 3 deletions src/FsAutoComplete.Core/Commands.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,8 @@ module Commands =
pt,
tast,
checkFileResults: FSharpCheckFileResults,
projectOptions: AnalyzerProjectOptions
projectOptions: AnalyzerProjectOptions,
analyzerPredicate
) =
let ctx: SDK.EditorContext =
{ FileName = UMX.untag file
Expand All @@ -1159,7 +1160,8 @@ module Commands =
CheckFileResults = Some checkFileResults
TypedTree = Some tast
CheckProjectResults = None
ProjectOptions = projectOptions }
ProjectOptions = projectOptions
AnalyzerIgnoreRanges = Ignore.getAnalyzerIgnoreRanges pt content }

let extractResultsFromAnalyzer (r: SDK.AnalysisResult) =
match r.Output with
Expand All @@ -1185,7 +1187,8 @@ module Commands =

async {
try
let! r = client.RunAnalyzersSafely ctx
let! r = client.RunAnalyzersSafely(ctx, analyzerPredicate)

return r |> List.collect extractResultsFromAnalyzer |> List.toArray
with ex ->
Loggers.analyzers.error (
Expand Down
2 changes: 1 addition & 1 deletion src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@
<Compile Include="Commands.fs" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
</Project>
2 changes: 1 addition & 1 deletion src/FsAutoComplete.Core/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ FSharp.Analyzers.Build
Serilog.Extensions.Logging

Microsoft.TestPlatform.ObjectModel
Microsoft.TestPlatform.TranslationLayer
Microsoft.TestPlatform.TranslationLayer
Loading