Skip to content

Commit

Permalink
Create parsingOption via CodeFormatterImpl helper. (#1946)
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Nov 24, 2021
1 parent b970671 commit 7db7213
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Fantomas.CoreGlobalTool.Tests/DaemonTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ let ``format signature file`` () =
formatted
"module Foobar
val meh : int
val meh: int
"
| otherResponse -> Assert.Fail $"Unexpected response %A{otherResponse}"
})
Expand Down
8 changes: 1 addition & 7 deletions src/Fantomas.CoreGlobalTool/Daemon.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ open System.Diagnostics
open System.IO
open System.Threading
open System.Threading.Tasks
open FSharp.Compiler.CodeAnalysis
open FSharp.Compiler.Text.Range
open FSharp.Compiler.Text.Position
open StreamJsonRpc
Expand All @@ -17,11 +16,6 @@ open Fantomas.SourceOrigin
open Fantomas.FormatConfig
open Fantomas.Extras.EditorConfig

let private createParsingOptionsFromFile (fileName: string) : FSharpParsingOptions =
{ FSharpParsingOptions.Default with
SourceFiles = [| fileName |]
IsExe = true }

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

Expand Down Expand Up @@ -64,7 +58,7 @@ type FantomasDaemon(sender: Stream, reader: Stream) as this =
request.FilePath,
SourceString request.SourceCode,
config,
createParsingOptionsFromFile request.FilePath,
CodeFormatterImpl.createParsingOptionsFromFile request.FilePath,
CodeFormatterImpl.sharedChecker.Value
)

Expand Down

0 comments on commit 7db7213

Please sign in to comment.