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

Create parsingOption via CodeFormatterImpl helper. #1946

Merged
merged 1 commit into from
Nov 3, 2021
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
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