diff --git a/src/Compiler/Service/BackgroundCompiler.fs b/src/Compiler/Service/BackgroundCompiler.fs index 54bea5584ad..d66847b5c17 100644 --- a/src/Compiler/Service/BackgroundCompiler.fs +++ b/src/Compiler/Service/BackgroundCompiler.fs @@ -123,6 +123,20 @@ type internal IBackgroundCompiler = userOpName: string -> Async + abstract GetProjectSnapshotFromScript: + fileName: string * + sourceText: ISourceTextNew * + previewEnabled: bool option * + loadedTimeStamp: System.DateTime option * + otherFlags: string array option * + useFsiAuxLib: bool option * + useSdkRefs: bool option * + sdkDirOverride: string option * + assumeDotNetFramework: bool option * + optionsStamp: int64 option * + userOpName: string -> + Async + abstract member GetSemanticClassificationForFile: fileName: string * options: FSharpProjectOptions * userOpName: string -> NodeCode @@ -1595,6 +1609,40 @@ type internal BackgroundCompiler userOpName ) + member _.GetProjectSnapshotFromScript + ( + fileName: string, + sourceText: ISourceTextNew, + previewEnabled: bool option, + loadedTimeStamp: DateTime option, + otherFlags: string array option, + useFsiAuxLib: bool option, + useSdkRefs: bool option, + sdkDirOverride: string option, + assumeDotNetFramework: bool option, + optionsStamp: int64 option, + userOpName: string + ) : Async = + async { + let! options, diagnostics = + self.GetProjectOptionsFromScript( + fileName, + sourceText, + previewEnabled, + loadedTimeStamp, + otherFlags, + useFsiAuxLib, + useSdkRefs, + sdkDirOverride, + assumeDotNetFramework, + optionsStamp, + userOpName + ) + + let! snapshot = FSharpProjectSnapshot.FromOptions(options, DocumentSource.FileSystem) + return snapshot, diagnostics + } + member _.GetSemanticClassificationForFile ( fileName: string, diff --git a/src/Compiler/Service/BackgroundCompiler.fsi b/src/Compiler/Service/BackgroundCompiler.fsi index 6d63c3b93e9..cd7c163a0d1 100644 --- a/src/Compiler/Service/BackgroundCompiler.fsi +++ b/src/Compiler/Service/BackgroundCompiler.fsi @@ -102,6 +102,20 @@ type internal IBackgroundCompiler = userOpName: string -> Async + abstract GetProjectSnapshotFromScript: + fileName: string * + sourceText: ISourceTextNew * + previewEnabled: bool option * + loadedTimeStamp: System.DateTime option * + otherFlags: string array option * + useFsiAuxLib: bool option * + useSdkRefs: bool option * + sdkDirOverride: string option * + assumeDotNetFramework: bool option * + optionsStamp: int64 option * + userOpName: string -> + Async + abstract GetSemanticClassificationForFile: fileName: string * snapshot: FSharpProjectSnapshot * userOpName: string -> NodeCode diff --git a/src/Compiler/Service/FSharpProjectSnapshot.fs b/src/Compiler/Service/FSharpProjectSnapshot.fs index a5ae2447db6..7ab252ef73b 100644 --- a/src/Compiler/Service/FSharpProjectSnapshot.fs +++ b/src/Compiler/Service/FSharpProjectSnapshot.fs @@ -123,7 +123,7 @@ type FSharpFileSnapshot(FileName: string, Version: string, GetSource: unit -> Ta /// A source file snapshot with loaded source text. type internal FSharpFileSnapshotWithSource - (FileName: string, SourceHash: ImmutableArray, Source: ISourceText, IsLastCompiland: bool, IsExe: bool) = + (FileName: string, SourceHash: ImmutableArray, Source: ISourceTextNew, IsLastCompiland: bool, IsExe: bool) = let version = lazy (SourceHash.ToBuilder().ToArray()) let stringVersion = lazy (version.Value |> BitConverter.ToString) diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index 19d383d00bd..e85488e7738 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -1,6 +1,7 @@ namespace FSharp.Compiler.CodeAnalysis.TransparentCompiler open System +open System.Linq open System.Collections.Generic open System.Runtime.CompilerServices open System.Diagnostics @@ -377,26 +378,51 @@ type internal TransparentCompiler let ComputeScriptClosure (fileName: string) - (source: ISourceText) + (source: ISourceTextNew) (defaultFSharpBinariesDir: string) (useSimpleResolution: bool) (useFsiAuxLib: bool option) (useSdkRefs: bool option) (sdkDirOverride: string option) (assumeDotNetFramework: bool option) - (projectSnapshot: ProjectSnapshot) + (projectIdentifier: ProjectIdentifier) + (otherOptions: string list) + (stamp: int64 option) = + let useFsiAuxLib = defaultArg useFsiAuxLib true + let useSdkRefs = defaultArg useSdkRefs true + let assumeDotNetFramework = defaultArg assumeDotNetFramework false + + let key = + { new ICacheKey with + member _.GetKey() = fileName, projectIdentifier + member _.GetLabel() = $"ScriptClosure for %s{fileName}" + + member _.GetVersion() = + Md5Hasher.empty + |> Md5Hasher.addStrings + [| + yield! otherOptions + match stamp with + | None -> () + | Some stamp -> string stamp + |] + |> Md5Hasher.addBytes (source.GetChecksum().ToArray()) + |> Md5Hasher.addBool useFsiAuxLib + |> Md5Hasher.addBool useFsiAuxLib + |> Md5Hasher.addBool useSdkRefs + |> Md5Hasher.addBool assumeDotNetFramework + |> Md5Hasher.toString + } + caches.ScriptClosure.Get( - projectSnapshot.FileKey fileName, + key, node { - let useFsiAuxLib = defaultArg useFsiAuxLib true - let useSdkRefs = defaultArg useSdkRefs true let reduceMemoryUsage = ReduceMemoryFlag.Yes - let assumeDotNetFramework = defaultArg assumeDotNetFramework false let applyCompilerOptions tcConfig = let fsiCompilerOptions = GetCoreFsiCompilerOptions tcConfig - ParseCompilerOptions(ignore, fsiCompilerOptions, projectSnapshot.OtherOptions) + ParseCompilerOptions(ignore, fsiCompilerOptions, otherOptions) let closure = LoadClosure.ComputeClosureOfScriptText( @@ -665,7 +691,9 @@ type internal TransparentCompiler None None None - projectSnapshot + projectSnapshot.Identifier + projectSnapshot.OtherOptions + projectSnapshot.Stamp return (Some closure) } @@ -1521,7 +1549,9 @@ type internal TransparentCompiler (Some tcConfig.useSdkRefs) tcConfig.sdkDirOverride (Some tcConfig.assumeDotNetFramework) - projectSnapshot + projectSnapshot.Identifier + projectSnapshot.OtherOptions + projectSnapshot.Stamp let typedResults = FSharpCheckFileResults.Make( @@ -2111,6 +2141,125 @@ type internal TransparentCompiler userOpName ) + member this.GetProjectSnapshotFromScript + ( + fileName: string, + sourceText: ISourceTextNew, + previewEnabled: bool option, + loadedTimeStamp: DateTime option, + otherFlags: string array option, + useFsiAuxLib: bool option, + useSdkRefs: bool option, + sdkDirOverride: string option, + assumeDotNetFramework: bool option, + optionsStamp: int64 option, + userOpName: string + ) : Async = + use _ = + Activity.start + "BackgroundCompiler.GetProjectOptionsFromScript" + [| Activity.Tags.fileName, fileName; Activity.Tags.userOpName, userOpName |] + + async { + // Use the same default as the background compiler. + let useFsiAuxLib = defaultArg useFsiAuxLib true + let useSdkRefs = defaultArg useSdkRefs true + let previewEnabled = defaultArg previewEnabled false + + // Do we assume .NET Framework references for scripts? + let assumeDotNetFramework = defaultArg assumeDotNetFramework true + + let extraFlags = + if previewEnabled then + [| "--langversion:preview" |] + else + [||] + + let otherFlags = defaultArg otherFlags extraFlags + use diagnostics = new DiagnosticsScope(otherFlags |> Array.contains "--flaterrors") + + let useSimpleResolution = + otherFlags |> Array.exists (fun x -> x = "--simpleresolution") + + let loadedTimeStamp = defaultArg loadedTimeStamp DateTime.MaxValue // Not 'now', we don't want to force reloading + let projectFileName = fileName + ".fsproj" + + let currentSourceFile = + FSharpFileSnapshot.Create(fileName, sourceText.GetHashCode().ToString(), (fun () -> Task.FromResult sourceText)) + + let! loadClosure = + ComputeScriptClosure + fileName + sourceText + FSharpCheckerResultsSettings.defaultFSharpBinariesDir + useSimpleResolution + (Some useFsiAuxLib) + (Some useSdkRefs) + sdkDirOverride + (Some assumeDotNetFramework) + (projectFileName, fileName) + (List.ofArray otherFlags) + optionsStamp + |> Async.AwaitNodeCode + + let otherFlags = + [ + yield "--noframework" + yield "--warn:3" + yield! otherFlags + for code, _ in loadClosure.NoWarns do + yield "--nowarn:" + code + ] + + let sourceFiles = + loadClosure.SourceFiles + |> List.map (fun (sf, _) -> + if sf = fileName then + currentSourceFile + else + FSharpFileSnapshot.CreateFromFileSystem sf) + + let references = + loadClosure.References + |> List.map (fun (r, _) -> + let lastModified = FileSystem.GetLastWriteTimeShim r + + { + Path = r + LastModified = lastModified + }) + + let snapshot = + FSharpProjectSnapshot.Create( + fileName + ".fsproj", + None, + sourceFiles, + references, + otherFlags, + List.empty, + false, + true, + loadedTimeStamp, + Some(FSharpUnresolvedReferencesSet(loadClosure.UnresolvedReferences)), + loadClosure.OriginalLoadReferences, + optionsStamp + ) + + let diags = + loadClosure.LoadClosureRootFileDiagnostics + |> List.map (fun (exn, isError) -> + FSharpDiagnostic.CreateFromException( + exn, + isError, + range.Zero, + false, + otherFlags |> List.contains "--flaterrors", + None + )) + + return snapshot, (diags @ diagnostics.Diagnostics) + } + member this.GetSemanticClassificationForFile(fileName: string, snapshot: FSharpProjectSnapshot, userOpName: string) = node { ignore userOpName diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index 82b43827e1f..94dce6286b5 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -557,6 +557,37 @@ type FSharpChecker userOpName ) + /// For a given script file, get the ProjectSnapshot implied by the #load closure + member _.GetProjectSnapshotFromScript + ( + fileName, + source, + ?previewEnabled, + ?loadedTimeStamp, + ?otherFlags, + ?useFsiAuxLib, + ?useSdkRefs, + ?assumeDotNetFramework, + ?sdkDirOverride, + ?optionsStamp: int64, + ?userOpName: string + ) = + let userOpName = defaultArg userOpName "Unknown" + + backgroundCompiler.GetProjectSnapshotFromScript( + fileName, + source, + previewEnabled, + loadedTimeStamp, + otherFlags, + useFsiAuxLib, + useSdkRefs, + sdkDirOverride, + assumeDotNetFramework, + optionsStamp, + userOpName + ) + member _.GetProjectOptionsFromCommandLineArgs(projectFileName, argv, ?loadedTimeStamp, ?isInteractive, ?isEditing) = let isEditing = defaultArg isEditing false let isInteractive = defaultArg isInteractive false diff --git a/src/Compiler/Service/service.fsi b/src/Compiler/Service/service.fsi index b8e87b805f8..cb8272b0f69 100644 --- a/src/Compiler/Service/service.fsi +++ b/src/Compiler/Service/service.fsi @@ -251,6 +251,34 @@ type public FSharpChecker = ?userOpName: string -> Async + /// Used to differentiate between scripts, to consider each script a separate project. Also used in formatted error messages. + /// The source for the file. + /// Is the preview compiler enabled. + /// Indicates when the script was loaded into the editing environment, + /// so that an 'unload' and 'reload' action will cause the script to be considered as a new project, + /// so that references are re-resolved. + /// Other flags for compilation. + /// Add a default reference to the FSharp.Compiler.Interactive.Settings library. + /// Use the implicit references from the .NET SDK. + /// Set up compilation and analysis for .NET Framework scripts. + /// Override the .NET SDK used for default references. + /// An optional unique stamp for the options. + /// An optional string used for tracing compiler operations associated with this request. + [] + member GetProjectSnapshotFromScript: + fileName: string * + source: ISourceTextNew * + ?previewEnabled: bool * + ?loadedTimeStamp: DateTime * + ?otherFlags: string[] * + ?useFsiAuxLib: bool * + ?useSdkRefs: bool * + ?assumeDotNetFramework: bool * + ?sdkDirOverride: string * + ?optionsStamp: int64 * + ?userOpName: string -> + Async + /// Get the FSharpProjectOptions implied by a set of command line arguments. /// /// Used to differentiate between projects and for the base directory of the project. diff --git a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs index cbc8e7690fe..2adb305a2ea 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs +++ b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs @@ -3,6 +3,7 @@ open System.Collections.Concurrent open System.Diagnostics open FSharp.Compiler.CodeAnalysis +open FSharp.Compiler.Text open Internal.Utilities.Collections open FSharp.Compiler.CodeAnalysis.TransparentCompiler open Internal.Utilities.Library.Extras @@ -894,4 +895,20 @@ let ``LoadClosure for script is recomputed after changes`` () = |> Seq.map (fun (k, g) -> k, g |> Seq.map fst |> Seq.toList) |> Map - Assert.Equal([Weakened; Requested; Started; Finished; Weakened; Requested; Started; Finished], closureComputations["FileFirst.fs"]) \ No newline at end of file + Assert.Equal([Weakened; Requested; Started; Finished; Weakened; Requested; Started; Finished], closureComputations["FileFirst.fs"]) + +[] +let ``Background compiler and Transparent compiler return the same options`` () = + async { + let backgroundChecker = FSharpChecker.Create(useTransparentCompiler = false) + let transparentChecker = FSharpChecker.Create(useTransparentCompiler = true) + let scriptName = Path.Combine(__SOURCE_DIRECTORY__, "script.fsx") + let content = SourceTextNew.ofString "" + + let! backgroundSnapshot, backgroundDiags = backgroundChecker.GetProjectSnapshotFromScript(scriptName, content) + let! transparentSnapshot, transparentDiags = transparentChecker.GetProjectSnapshotFromScript(scriptName, content) + Assert.Empty(backgroundDiags) + Assert.Empty(transparentDiags) + Assert.Equal(backgroundSnapshot.OtherOptions, transparentSnapshot.OtherOptions) + Assert.Equal(backgroundSnapshot.ReferencesOnDisk, transparentSnapshot.ReferencesOnDisk) + } diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index e526351effd..69fb762ea84 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -2067,6 +2067,7 @@ FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileAnswer]] ParseAndCheckFileInProject(System.String, Int32, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults]] GetBackgroundCheckResultsForFileInProject(System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectOptionsFromScript(System.String, FSharp.Compiler.Text.ISourceText, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String]) +FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectSnapshotFromScript(System.String, FSharp.Compiler.Text.ISourceTextNew, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Diagnostics.FSharpDiagnostic[],System.Int32]] Compile(System.String[], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range][]] MatchBraces(System.String, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.FSharpParsingOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range][]] MatchBraces(System.String, System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index e526351effd..69fb762ea84 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -2067,6 +2067,7 @@ FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileAnswer]] ParseAndCheckFileInProject(System.String, Int32, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults]] GetBackgroundCheckResultsForFileInProject(System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectOptionsFromScript(System.String, FSharp.Compiler.Text.ISourceText, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String]) +FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectSnapshotFromScript(System.String, FSharp.Compiler.Text.ISourceTextNew, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Diagnostics.FSharpDiagnostic[],System.Int32]] Compile(System.String[], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range][]] MatchBraces(System.String, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.FSharpParsingOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range][]] MatchBraces(System.String, System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String])