Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v6.0 #2800

Merged
merged 34 commits into from
Mar 27, 2023
Merged

v6.0 #2800

Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ea60b22
Extend logging and verbosity options (#2693)
dawedawe Jan 15, 2023
e1c0926
Sunset MultilineBlockBracketsOnSameColumn & ExperimentalStroustrupSty…
dawedawe Jan 20, 2023
240b135
Move FormatConfig into Fantomas.Core namespace. (#2736)
nojaf Jan 20, 2023
43d47fc
Let the icons (green, orange, ...) in the explanation be rendered. (#…
dawedawe Jan 23, 2023
bfaf6af
Initial cursor (#2739)
nojaf Jan 24, 2023
05263a0
Update output for copy-and-update expression for Stroustrup (#2748)
josh-degraw Jan 31, 2023
3bc97eb
Refactor IsStroustrupStyleExpr and isStroustrupStyleType into Context…
josh-degraw Feb 1, 2023
9b2e32c
Drop `Experimental` prefix from `ExperimentalStroustrup`. (#2755)
josh-degraw Feb 1, 2023
43c5e0b
Expose SyntaxOak API (#2758)
edgarfgp Feb 1, 2023
ac3b8ac
Extract setting for preference of newline placement for computation e…
josh-degraw Feb 2, 2023
c83a7d1
Remove F# option from public API. (#2759)
nojaf Feb 3, 2023
7bcd5a5
Adds naive parallel formatting implementation.
TheAngryByrd Feb 4, 2023
e528cc6
Add separate CodeFormatter.FormatDocumentAsync overloads with cursor …
DedSec256 Feb 4, 2023
9681ea5
Add release notes for 6.0.0-alpha-003.
nojaf Feb 4, 2023
ea8af47
Consolidate and share logic for Records and AnonymousRecords (#2750)
josh-degraw Feb 8, 2023
77ca940
Add Spectr.Console (#2765)
nojaf Feb 10, 2023
691100c
Consolidate records part two (#2766)
nojaf Feb 11, 2023
73fa7d7
Upgrade guide (#2767)
nojaf Feb 12, 2023
770e361
Update GeneratingCode.fsx to use the Oak model. (#2769)
nojaf Feb 14, 2023
78b4c8b
Always process folder recursive. (#2775)
nojaf Feb 18, 2023
82ffbaf
Move profile logic to Format.fs and use Spectre (#2770)
dawedawe Feb 20, 2023
91253aa
Don't hook up SerilogTraceListener in FantomasDaemon. (#2777)
nojaf Feb 22, 2023
0a84d82
Add release notes for 6.0.0-alpha-004.
nojaf Feb 22, 2023
5ea3fdb
Fix record type generation for stroustrup types with members (#2773)
josh-degraw Feb 23, 2023
0c73517
Fix handling of AppExpr with a single stroustrup record (#2747)
josh-degraw Feb 23, 2023
d96f018
Manually deserialize FormatDocumentResponse. (#2780)
nojaf Feb 24, 2023
392f8db
Add release notes for 6.0.0-alpha-005.
nojaf Feb 24, 2023
118a666
Extract Stroustrup for final list argument into a separate setting. (…
nojaf Mar 6, 2023
5a020e3
Fix Stroustrup record member declaration indent issue (#2788)
josh-degraw Mar 7, 2023
76be1b9
EndsWithSingleListApp & EndsWithDualListApp are enable by IsStroustru…
nojaf Mar 17, 2023
e8106b1
Add release notes for 6.0.0-alpha-006.
nojaf Mar 17, 2023
1aba34c
Remove strict mode (#2798)
nojaf Mar 18, 2023
17deecc
Cursor with defines (#2774)
nojaf Mar 19, 2023
21b11d3
Return string from FormatASTAsync api. (#2799)
nojaf Mar 27, 2023
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
Prev Previous commit
Next Next commit
Don't hook up SerilogTraceListener in FantomasDaemon. (#2777)
nojaf committed Mar 17, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 91253aac68755fb9c74d37e7e1b12ad68e01fc75
1 change: 1 addition & 0 deletions src/Fantomas.Tests/Fantomas.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@
<Compile Include="Integration\WriteTests.fs" />
<Compile Include="Integration\DaemonTests.fs" />
<Compile Include="Integration\ForceTests.fs" />
<Compile Include="ToolLocatorTests.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FSharp.Core" Version="$(FSharpCoreVersion)" />
25 changes: 25 additions & 0 deletions src/Fantomas.Tests/ToolLocatorTests.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module Fantomas.CoreGlobalTool.Tests.ToolLocatorTests

open Fantomas.Client
open Fantomas.Client.LSPFantomasServiceTypes
open Fantomas.Client.Contracts
open NUnit.Framework

[<Explicit "This is meant to troubleshoot local problems">]
[<Test>]
let ``locate fantomas tool`` () =
let pwd = @"C:\Users\nojaf\Projects"
let result = FantomasToolLocator.findFantomasTool (Folder pwd)

match result with
| Error error -> Assert.Fail $"Could not locate tool: %A{error}"
| Ok(FantomasToolFound(FantomasVersion(version), startInfo)) ->
let result = FantomasToolLocator.createFor startInfo

match result with
| Error error -> Assert.Fail $"Could not start tool: %A{error}"
| Ok runningFantomasTool ->
let version2 =
runningFantomasTool.RpcClient.InvokeAsync<string>(Methods.Version).Result

Assert.AreEqual(version, $"v{version2}")
9 changes: 5 additions & 4 deletions src/Fantomas/Daemon.fs
Original file line number Diff line number Diff line change
@@ -16,13 +16,12 @@ open Fantomas.EditorConfig

type FantomasDaemon(sender: Stream, reader: Stream) as this =
let rpc: JsonRpc = JsonRpc.Attach(sender, reader, this)
let traceListener = new DefaultTraceListener()

do
// hook up request/response logging for debugging
rpc.TraceSource <- TraceSource(typeof<FantomasDaemon>.Name, SourceLevels.Verbose)

rpc.TraceSource.Listeners.Add(new SerilogTraceListener.SerilogTraceListener(typeof<FantomasDaemon>.Name))
|> ignore<int>
rpc.TraceSource.Listeners.Add traceListener |> ignore<int>

let disconnectEvent = new ManualResetEvent(false)

@@ -33,7 +32,9 @@ type FantomasDaemon(sender: Stream, reader: Stream) as this =
do rpc.Disconnected.Add(fun _ -> exit ())

interface IDisposable with
member this.Dispose() = disconnectEvent.Dispose()
member this.Dispose() =
traceListener.Dispose()
disconnectEvent.Dispose()

/// returns a hot task that resolves when the stream has terminated
member this.WaitForClose = rpc.Completion