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

Expose FSharpParserDiagnostic from parseFile. #2233

Merged
merged 2 commits into from
May 7, 2022
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [5.0.0-alpha-004] - 2022-05-07

### Changed
* FCS: Expose FSharpParserDiagnostic from parseFile. [https://github.com/fsprojects/fantomas/pull/2233](2233)

## [5.0.0-alpha-003] - 2022-05-06

### Changed
Expand Down
2 changes: 2 additions & 0 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ github: fsprojects/fantomas:829faa6ba834f99afed9b4434b3a1680536474b2 src/Fantoma

# F# compiler source
github: dotnet/fsharp:7de9637f8d7839c2312748dcbbabb4cda7455548 src/fsharp/FSComp.txt
github: dotnet/fsharp:7de9637f8d7839c2312748dcbbabb4cda7455548 src/fsharp/fsi/FSIstrings.txt
github: dotnet/fsharp:7de9637f8d7839c2312748dcbbabb4cda7455548 src/fsharp/FSStrings.resx
github: dotnet/fsharp:7de9637f8d7839c2312748dcbbabb4cda7455548 src/fsharp/utils/sformat.fsi
github: dotnet/fsharp:7de9637f8d7839c2312748dcbbabb4cda7455548 src/fsharp/utils/sformat.fs
github: dotnet/fsharp:7de9637f8d7839c2312748dcbbabb4cda7455548 src/fsharp/sr.fsi
Expand Down
4 changes: 3 additions & 1 deletion paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ NUGET
System.Security.AccessControl (>= 5.0)
System.Security.Principal.Windows (>= 5.0)
System.Management (6.0)
Microsoft.Win32.Registry (>= 5.0) - restriction: || (&& (== net6.0) (== netstandard2.0)) (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp3.1))
Microsoft.Win32.Registry (>= 5.0) - restriction: || (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp3.1))
System.CodeDom (>= 6.0)
System.Memory (4.5.4)
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (&& (== netcoreapp3.1) (>= monotouch)) (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netcoreapp2.0)) (&& (== netcoreapp3.1) (< netstandard1.1)) (&& (== netcoreapp3.1) (< netstandard2.0)) (&& (== netcoreapp3.1) (>= xamarinios)) (&& (== netcoreapp3.1) (>= xamarinmac)) (&& (== netcoreapp3.1) (>= xamarintvos)) (&& (== netcoreapp3.1) (>= xamarinwatchos)) (== netstandard2.0)
Expand Down Expand Up @@ -214,6 +214,8 @@ GITHUB
src/fsharp/ErrorLogger.fs (7de9637f8d7839c2312748dcbbabb4cda7455548)
src/fsharp/ErrorLogger.fsi (7de9637f8d7839c2312748dcbbabb4cda7455548)
src/fsharp/FSComp.txt (7de9637f8d7839c2312748dcbbabb4cda7455548)
src/fsharp/fsi/FSIstrings.txt (7de9637f8d7839c2312748dcbbabb4cda7455548)
src/fsharp/FSStrings.resx (7de9637f8d7839c2312748dcbbabb4cda7455548)
src/fsharp/InternalCollections.fs (7de9637f8d7839c2312748dcbbabb4cda7455548)
src/fsharp/InternalCollections.fsi (7de9637f8d7839c2312748dcbbabb4cda7455548)
src/fsharp/LanguageFeatures.fs (7de9637f8d7839c2312748dcbbabb4cda7455548)
Expand Down
4 changes: 2 additions & 2 deletions src/Fantomas.Core/CodeFormatterImpl.fs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let parse (isSignature: bool) (source: ISourceText) : Async<(ParsedInput * Defin
async {
let errors =
baseDiagnostics
|> List.filter (fun (_, s) -> s = FSharpDiagnosticSeverity.Error)
|> List.filter (fun d -> d.Severity = FSharpDiagnosticSeverity.Error)

if not errors.IsEmpty then
raise (FormatException $"Parsing failed with errors: %A{baseDiagnostics}\nAnd options: %A{[]}")
Expand All @@ -48,7 +48,7 @@ let parse (isSignature: bool) (source: ISourceText) : Async<(ParsedInput * Defin

let errors =
diagnostics
|> List.filter (fun (_, s) -> s = FSharpDiagnosticSeverity.Error)
|> List.filter (fun d -> d.Severity = FSharpDiagnosticSeverity.Error)

if not errors.IsEmpty then
raise (FormatException $"Parsing failed with errors: %A{diagnostics}\nAnd options: %A{[]}")
Expand Down
7 changes: 7 additions & 0 deletions src/Fantomas.FCS/Fantomas.FCS.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
<EmbeddedText Include="..\..\paket-files\dotnet\fsharp\src\fsharp\FSComp.txt">
<Link>FSComp.txt</Link>
</EmbeddedText>
<EmbeddedText Include="..\..\paket-files\dotnet\fsharp\src\fsharp\fsi\FSIstrings.txt">
<Link>FSIstrings.txt</Link>
</EmbeddedText>
<EmbeddedResource Include="..\..\paket-files\dotnet\fsharp\src\fsharp\FSStrings.resx">
<Link>FSStrings.resx</Link>
<LogicalName>FSStrings.resources</LogicalName>
</EmbeddedResource>
<Compile Include="..\..\paket-files\dotnet\fsharp\src\fsharp\utils\sformat.fsi">
<Link>ErrorText\sformat.fsi</Link>
</Compile>
Expand Down
Loading