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

FileSystem access should go via IFileSystem (+refactoring) #11112

Merged
merged 17 commits into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from 9 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
280 changes: 140 additions & 140 deletions src/fsharp/BinaryResourceFormats.fs

Large diffs are not rendered by default.

6,799 changes: 3,399 additions & 3,400 deletions src/fsharp/CheckExpressions.fs

Large diffs are not rendered by default.

285 changes: 142 additions & 143 deletions src/fsharp/CompilerConfig.fs

Large diffs are not rendered by default.

107 changes: 54 additions & 53 deletions src/fsharp/CompilerConfig.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
module internal FSharp.Compiler.CompilerConfig

open System
open FSharp.Compiler.IO
open Internal.Utilities
open Internal.Utilities.Library
open FSharp.Compiler
Expand All @@ -24,7 +25,7 @@ exception LoadedSourceNotFoundIgnoring of (*filename*) string * range

/// Represents a reference to an F# assembly. May be backed by a real assembly on disk (read by Abstract IL), or a cross-project
/// reference in FSharp.Compiler.Service.
type IRawFSharpAssemblyData =
type IRawFSharpAssemblyData =

/// The raw list AutoOpenAttribute attributes in the assembly
abstract GetAutoOpenAttributes: ILGlobals -> string list
Expand Down Expand Up @@ -56,55 +57,55 @@ type IRawFSharpAssemblyData =

abstract ShortAssemblyName: string

type TimeStampCache =
type TimeStampCache =
new: defaultTimeStamp: DateTime -> TimeStampCache
member GetFileTimeStamp: string -> DateTime
member GetProjectReferenceTimeStamp: IProjectReference -> DateTime

and IProjectReference =
and IProjectReference =

/// The name of the assembly file generated by the project
abstract FileName: string
abstract FileName: string

/// Evaluate raw contents of the assembly file generated by the project
abstract EvaluateRawContents: CompilationThreadToken -> Cancellable<IRawFSharpAssemblyData option>

/// Get the logical timestamp that would be the timestamp of the assembly file generated by the project.
///
/// For project references this is maximum of the timestamps of all dependent files.
/// The project is not actually built, nor are any assemblies read, but the timestamps for each dependent file
/// The project is not actually built, nor are any assemblies read, but the timestamps for each dependent file
/// are read via the FileSystem. If the files don't exist, then a default timestamp is used.
///
/// The operation returns None only if it is not possible to create an IncrementalBuilder for the project at all, e.g. if there
/// are fatal errors in the options for the project.
abstract TryGetLogicalTimeStamp: TimeStampCache -> System.DateTime option

type AssemblyReference =
type AssemblyReference =
| AssemblyReference of range * string * IProjectReference option

member Range: range

member Text: string

member ProjectReference: IProjectReference option

member SimpleAssemblyNameIs: string -> bool

type UnresolvedAssemblyReference = UnresolvedAssemblyReference of string * AssemblyReference list

[<RequireQualifiedAccess>]
type CompilerTarget =
| WinExe
| ConsoleExe
| Dll
type CompilerTarget =
| WinExe
| ConsoleExe
| Dll
| Module
member IsExe: bool

[<RequireQualifiedAccess>]
type CopyFSharpCoreFlag = Yes | No

/// Represents the file or string used for the --version flag
type VersionFlag =
type VersionFlag =
| VersionString of string
| VersionFile of string
| VersionNone
Expand Down Expand Up @@ -188,15 +189,15 @@ type TcConfigBuilder =
mutable printAllSignatureFiles: bool
mutable xmlDocOutputFile: string option
mutable stats: bool
mutable generateFilterBlocks: bool
mutable generateFilterBlocks: bool
mutable signer: string option
mutable container: string option
mutable delaysign: bool
mutable publicsign: bool
mutable version: VersionFlag
mutable version: VersionFlag
mutable metadataVersion: string option
mutable standalone: bool
mutable extraStaticLinkRoots: string list
mutable extraStaticLinkRoots: string list
mutable noSignatureData: bool
mutable onlyEssentialOptimizationData: bool
mutable useOptimizationDataFile: bool
Expand All @@ -209,8 +210,8 @@ type TcConfigBuilder =
mutable ignoreSymbolStoreSequencePoints: bool
mutable internConstantStrings: bool
mutable extraOptimizationIterations: int
mutable win32icon: string
mutable win32res: string
mutable win32icon: string
mutable win32res: string
mutable win32manifest: string
mutable includewin32manifest: bool
mutable linkResources: string list
Expand All @@ -226,13 +227,13 @@ type TcConfigBuilder =
#if DEBUG
mutable showOptimizationData: bool
#endif
mutable showTerms : bool
mutable writeTermsToFiles: bool
mutable doDetuple : bool
mutable doTLR : bool
mutable showTerms : bool
mutable writeTermsToFiles: bool
mutable doDetuple : bool
mutable doTLR : bool
mutable doFinalSimplify: bool
mutable optsOn : bool
mutable optSettings : Optimizer.OptimizationSettings
mutable optsOn : bool
mutable optSettings : Optimizer.OptimizationSettings
mutable emitTailcalls: bool
mutable deterministic: bool
mutable concurrentBuild: bool
Expand All @@ -246,15 +247,15 @@ type TcConfigBuilder =
#if !NO_EXTENSIONTYPING
mutable showExtensionTypeMessages: bool
#endif
mutable pause: bool
mutable pause: bool
mutable alwaysCallVirt: bool
mutable noDebugData: bool

/// If true, indicates all type checking and code generation is in the context of fsi.exe
isInteractive: bool
isInvalidationSupported: bool
isInteractive: bool
isInvalidationSupported: bool
mutable emitDebugInfoInQuotations: bool
mutable exename: string option
mutable exename: string option
mutable copyFSharpCore: CopyFSharpCoreFlag
mutable shadowCopyReferences: bool
mutable useSdkRefs: bool
Expand All @@ -281,18 +282,18 @@ type TcConfigBuilder =

static member CreateNew:
legacyReferenceResolver: LegacyReferenceResolver *
defaultFSharpBinariesDir: string *
reduceMemoryUsage: ReduceMemoryFlag *
implicitIncludeDir: string *
isInteractive: bool *
defaultFSharpBinariesDir: string *
reduceMemoryUsage: ReduceMemoryFlag *
implicitIncludeDir: string *
isInteractive: bool *
isInvalidationSupported: bool *
defaultCopyFSharpCore: CopyFSharpCoreFlag *
tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot *
sdkDirOverride: string option *
rangeForErrors: range
-> TcConfigBuilder

member DecideNames: string list -> outfile: string * pdbfile: string option * assemblyName: string
member DecideNames: string list -> outfile: string * pdbfile: string option * assemblyName: string

member TurnWarningOff: range * string -> unit

Expand Down Expand Up @@ -380,15 +381,15 @@ type TcConfig =
member printAllSignatureFiles: bool
member xmlDocOutputFile: string option
member stats: bool
member generateFilterBlocks: bool
member generateFilterBlocks: bool
member signer: string option
member container: string option
member delaysign: bool
member publicsign: bool
member version: VersionFlag
member version: VersionFlag
member metadataVersion: string option
member standalone: bool
member extraStaticLinkRoots: string list
member extraStaticLinkRoots: string list
member noSignatureData: bool
member onlyEssentialOptimizationData: bool
member useOptimizationDataFile: bool
Expand All @@ -402,7 +403,7 @@ type TcConfig =
member internConstantStrings: bool
member extraOptimizationIterations: int
member win32icon: string
member win32res: string
member win32res: string
member win32manifest: string
member includewin32manifest: bool
member linkResources: string list
Expand All @@ -417,18 +418,18 @@ type TcConfig =
#if DEBUG
member showOptimizationData: bool
#endif
member showTerms : bool
member writeTermsToFiles: bool
member doDetuple : bool
member doTLR : bool
member showTerms : bool
member writeTermsToFiles: bool
member doDetuple : bool
member doTLR : bool
member doFinalSimplify: bool
member optSettings : Optimizer.OptimizationSettings
member optSettings : Optimizer.OptimizationSettings
member emitTailcalls: bool
member deterministic: bool
member concurrentBuild: bool
member pathMap: PathMap
member preferredUiLang: string option
member optsOn : bool
member optsOn : bool
member productNameForBannerText: string
member showBanner : bool
member showTimes: bool
Expand All @@ -437,13 +438,13 @@ type TcConfig =
#if !NO_EXTENSIONTYPING
member showExtensionTypeMessages: bool
#endif
member pause: bool
member pause: bool
member alwaysCallVirt: bool
member noDebugData: bool

/// If true, indicates all type checking and code generation is in the context of fsi.exe
member isInteractive: bool
member isInvalidationSupported: bool
member isInvalidationSupported: bool

member xmlDocInfoLoader: IXmlDocumentationInfoLoader option

Expand All @@ -452,11 +453,11 @@ type TcConfig =
member ComputeLightSyntaxInitialStatus: string -> bool

member GetTargetFrameworkDirectories: unit -> string list

/// Get the loaded sources that exist and issue a warning for the ones that don't
member GetAvailableLoadedSources: unit -> (range*string) list
member ComputeCanContainEntryPoint: sourceFiles:string list -> bool list *bool

member ComputeCanContainEntryPoint: sourceFiles:string list -> bool list *bool

/// File system query based on TcConfig settings
member ResolveSourceFile: range * filename: string * pathLoadedFrom: string -> string
Expand Down Expand Up @@ -510,7 +511,7 @@ type TcConfig =
member CloneToBuilder: unit -> TcConfigBuilder

/// Indicates if the compilation will result in F# signature data resource in the generated binary
member GenerateSignatureData: bool
member GenerateSignatureData: bool

/// Indicates if the compilation will result in an F# optimization data resource in the generated binary
member GenerateOptimizationData: bool
Expand All @@ -521,7 +522,7 @@ type TcConfig =
/// Represents a computation to return a TcConfig. Normally this is just a constant immutable TcConfig,
/// but for F# Interactive it may be based on an underlying mutable TcConfigBuilder.
[<Sealed>]
type TcConfigProvider =
type TcConfigProvider =

member Get: CompilationThreadToken -> TcConfig

Expand Down Expand Up @@ -555,4 +556,4 @@ val FSharpLightSyntaxFileSuffixes: string list

val doNotRequireNamespaceOrModuleSuffixes: string list

val mlCompatSuffixes: string list
val mlCompatSuffixes: string list
Loading