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

Remove FSharpProjectOptions from Transparent Compiler check results #18205

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions src/Compiler/Service/BackgroundCompiler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ type internal BackgroundCompiler
tcProj.TcGlobals,
options.IsIncompleteTypeCheckEnvironment,
Some builder,
options,
Some options,
Array.ofList tcDependencyFiles,
creationDiags,
parseResults.Diagnostics,
Expand Down Expand Up @@ -1247,7 +1247,7 @@ type internal BackgroundCompiler
tcEnvAtEnd.AccessRights,
tcAssemblyExprOpt,
Array.ofList tcDependencyFiles,
options)
Some options)

let results =
FSharpCheckProjectResults(
Expand Down
14 changes: 8 additions & 6 deletions src/Compiler/Service/FSharpCheckerResults.fs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ type internal TypeCheckInfo
tcAccessRights: AccessorDomain,
projectFileName: string,
mainInputFileName: string,
projectOptions: FSharpProjectOptions,
projectOptions: FSharpProjectOptions option,
sResolutions: TcResolutions,
sSymbolUses: TcSymbolUses,
sFallback: NameResolutionEnv,
Expand Down Expand Up @@ -3289,7 +3289,7 @@ module internal ParseAndCheckFile =
tcEnvAtEnd.AccessRights,
projectFileName,
mainInputFileName,
projectOptions,
Some projectOptions,
sink.GetResolutions(),
sink.GetSymbolUses(),
tcEnvAtEnd.NameEnv,
Expand All @@ -3302,9 +3302,11 @@ module internal ParseAndCheckFile =
}

[<Sealed>]
type FSharpProjectContext(thisCcu: CcuThunk, assemblies: FSharpAssembly list, ad: AccessorDomain, projectOptions: FSharpProjectOptions) =
type FSharpProjectContext
(thisCcu: CcuThunk, assemblies: FSharpAssembly list, ad: AccessorDomain, projectOptions: FSharpProjectOptions option) =

member _.ProjectOptions = projectOptions
member _.ProjectOptions =
projectOptions |> Option.defaultWith (fun () -> failwith "not available")

member _.GetReferencedAssemblies() = assemblies

Expand Down Expand Up @@ -3713,7 +3715,7 @@ type FSharpCheckProjectResults
AccessorDomain *
CheckedImplFile list option *
string[] *
FSharpProjectOptions) option
FSharpProjectOptions option) option
) =

let getDetails () =
Expand Down Expand Up @@ -4009,7 +4011,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, tcConfig: TcConfig, tcGlobal
tcState.TcEnvFromImpls.AccessRights,
None,
dependencyFiles,
projectOptions)
Some projectOptions)

let projectResults =
FSharpCheckProjectResults(fileName, Some tcConfig, keepAssemblyContents, errors, Some details)
Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/Service/FSharpCheckerResults.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ type public FSharpCheckFileResults =
tcGlobals: TcGlobals *
isIncompleteTypeCheckEnvironment: bool *
builder: IncrementalBuilder option *
projectOptions: FSharpProjectOptions *
projectOptions: FSharpProjectOptions option *
dependencyFiles: string[] *
creationErrors: FSharpDiagnostic[] *
parseErrors: FSharpDiagnostic[] *
Expand Down Expand Up @@ -554,7 +554,7 @@ type public FSharpCheckProjectResults =
AccessorDomain *
CheckedImplFile list option *
string[] *
FSharpProjectOptions) option ->
FSharpProjectOptions option) option ->
FSharpCheckProjectResults

module internal ParseAndCheckFile =
Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/Service/TransparentCompiler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1695,7 +1695,7 @@ type internal TransparentCompiler
bootstrapInfo.TcGlobals,
projectSnapshot.IsIncompleteTypeCheckEnvironment,
None,
projectSnapshot.ToOptions(),
None,
Array.ofList tcInfo.tcDependencyFiles,
creationDiags,
parseResults.Diagnostics,
Expand Down Expand Up @@ -1962,7 +1962,7 @@ type internal TransparentCompiler
tcEnvAtEnd.AccessRights,
Some checkedImplFiles,
Array.ofList tcDependencyFiles,
projectSnapshot.ToOptions())
None)

let results =
FSharpCheckProjectResults(
Expand Down
Loading