diff options
author | David Karlaš <david.karlas@microsoft.com> | 2019-01-11 16:42:43 +0300 |
---|---|---|
committer | David Karlaš <david.karlas@microsoft.com> | 2019-01-11 16:42:43 +0300 |
commit | 45a18986735b1440f38fdc1c604773f7be850a7f (patch) | |
tree | 52a35188a823733b0f554cbe4d837b651cf8c53e /main/external/fsharpbinding | |
parent | a8376aded4ab3272dd0d84b6d4e3e106753b9331 (diff) |
Fix building F# project
Diffstat (limited to 'main/external/fsharpbinding')
-rw-r--r-- | main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpFormatter.fs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpFormatter.fs b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpFormatter.fs index 6faf4bd7f7..54e501cde4 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpFormatter.fs +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpFormatter.fs @@ -76,7 +76,9 @@ type FSharpFormatter() = | Document, Some projectOptions -> let output = try - let formatted = CodeFormatter.FormatDocumentAsync(filename, input, config, projectOptions, languageService.Checker) + let checker = SourceCodeServices.FSharpChecker.Create() + let parsingOptions, _errors = checker.GetParsingOptionsFromProjectOptions(projectOptions) + let formatted = CodeFormatter.FormatDocumentAsync(filename, input, config, parsingOptions, languageService.Checker) |> Async.RunSynchronously let result = trimIfNeeded input formatted @@ -111,7 +113,9 @@ type FSharpFormatter() = let! result = try let selection = input.Substring(fromOffset, toOffset - fromOffset) - let formatted = CodeFormatter.FormatSelectionAsync(filename, range, input, config, projectOptions, languageService.Checker) + let checker = SourceCodeServices.FSharpChecker.Create() + let parsingOptions, _errors = checker.GetParsingOptionsFromProjectOptions(projectOptions) + let formatted = CodeFormatter.FormatSelectionAsync(filename, range, input, config, parsingOptions, languageService.Checker) |> Async.RunSynchronously let result = trimIfNeeded input formatted match editor with |