PageRenderTime 38ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/compiler/3.1/Nov2013/src/fsharp/vs/IncrementalBuild.fsi

#
F# | 176 lines | 90 code | 30 blank | 56 comment | 0 complexity | ea4a143a7dde5a8f96c9ae7333e8e9df MD5 | raw file
Possible License(s): CC-BY-SA-3.0, Apache-2.0
  1. namespace Microsoft.FSharp.Compiler
  2. open Microsoft.FSharp.Compiler
  3. open Microsoft.FSharp.Compiler.Range
  4. open Microsoft.FSharp.Compiler.ErrorLogger
  5. open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
  6. open Microsoft.FSharp.Compiler.Build
  7. [<RequireQualifiedAccess>]
  8. type internal Severity =
  9. | Warning
  10. | Error
  11. type internal ErrorInfo =
  12. { FileName:string
  13. StartLine:int
  14. EndLine:int
  15. StartColumn:int
  16. EndColumn:int
  17. Severity:Severity
  18. Message:string
  19. Subcategory:string }
  20. static member CreateFromExceptionAndAdjustEof : PhasedError * bool * bool * range * (int*int) -> ErrorInfo
  21. // implementation details used by other code in the compiler
  22. [<Sealed>]
  23. type internal ErrorScope =
  24. interface System.IDisposable
  25. new : unit -> ErrorScope
  26. member ErrorsAndWarnings : ErrorInfo list
  27. static member Protect<'a> : range -> (unit->'a) -> (string->'a) -> 'a
  28. static member ProtectWithDefault<'a> : range -> (unit -> 'a) -> 'a -> 'a
  29. static member ProtectAndDiscard : range -> (unit -> unit) -> unit
  30. /// Generalized Incremental Builder. This is exposed only for unittesting purposes.
  31. module internal IncrementalBuild =
  32. // A build scalar.
  33. type Scalar<'T> = interface end
  34. /// A build vector.
  35. type Vector<'T> = interface end
  36. /// A set of build rules and the corresponding, possibly partial, results from building.
  37. type PartialBuild
  38. /// Declares a vector build input.
  39. /// Only required for unit testing.
  40. val InputScalar : string -> Scalar<'T>
  41. /// Declares a scalar build input.
  42. /// Only required for unit testing.
  43. val InputVector : string -> Vector<'T>
  44. /// Methods for acting on build Scalars
  45. /// Only required for unit testing.
  46. module Scalar =
  47. /// Apply a function to one scalar to produce another.
  48. val Map : string -> ('I -> 'O) -> Scalar<'I> -> Scalar<'O>
  49. /// Apply a function to scalar value to produce a vector.
  50. val Multiplex : string -> ('I -> 'O[])->Scalar<'I> -> Vector<'O>
  51. /// Methods for acting on build Vectors
  52. /// Only required for unit testing.
  53. module Vector =
  54. /// Maps one vector to another using the given function.
  55. val Map : string -> ('I -> 'O) -> Vector<'I> -> Vector<'O>
  56. /// Updates the creates a new vector with the same items but with
  57. /// timestamp specified by the passed-in function.
  58. val Stamp : string -> ('I -> System.DateTime) -> Vector<'I> -> Vector<'I>
  59. /// Apply a function to each element of the vector, threading an accumulator argument
  60. /// through the computation. Returns intermediate results in a vector.
  61. val ScanLeft : string -> ('A -> 'I -> Eventually<'A>) -> Scalar<'A> -> Vector<'I> -> Vector<'A>
  62. /// Apply a function to a vector to get a scalar value.
  63. val Demultiplex : string -> ('I[] -> 'O)->Vector<'I> -> Scalar<'O>
  64. /// Convert a Vector into a Scalar.
  65. val AsScalar: string -> Vector<'I> -> Scalar<'I[]>
  66. /// Evaluate a build. Only required for unit testing.
  67. val Eval : string -> PartialBuild -> PartialBuild
  68. /// Do one step in the build. Only required for unit testing.
  69. val Step : (string -> PartialBuild -> PartialBuild option)
  70. /// Get a scalar vector. Result must be available. Only required for unit testing.
  71. val GetScalarResult<'T> : string * PartialBuild -> ('T * System.DateTime) option
  72. /// Get a result vector. All results must be available or thrown an exception. Only required for unit testing.
  73. val GetVectorResult<'T> : string * PartialBuild -> 'T[]
  74. /// Get an element of vector result or None if there were no results. Only required for unit testing.
  75. val GetVectorResultBySlot<'T> : string*int*PartialBuild -> ('T * System.DateTime) option
  76. /// Declare build outputs and bind them to real values.
  77. /// Only required for unit testing.
  78. type BuildDescriptionScope =
  79. new : unit -> BuildDescriptionScope
  80. /// Declare a named scalar output.
  81. member DeclareScalarOutput : name:string * output:Scalar<'T> -> unit
  82. /// Declare a named vector output.
  83. member DeclareVectorOutput : name:string * output:Vector<'T> -> unit
  84. /// Set the conrete inputs for this build.
  85. member GetInitialPartialBuild : vectorinputs:(string * int * obj list) list * scalarinputs:(string*obj) list -> PartialBuild
  86. /// Incremental builder for F# parsing and type checking.
  87. module internal IncrementalFSharpBuild =
  88. /// Used for unit testing
  89. type IBEvent =
  90. | IBEParsed of string // filename
  91. | IBETypechecked of string // filename
  92. | IBEDeleted
  93. /// Used for unit testing
  94. val GetMostRecentIncrementalBuildEvents : int -> IBEvent list
  95. /// Used for unit testing
  96. val GetCurrentIncrementalBuildEventNum : unit -> int
  97. type FileDependency = {
  98. // Name of the file
  99. Filename : string
  100. // If true, then deletion or creation of this file should trigger an entirely fresh build
  101. ExistenceDependency : bool
  102. // If true, then changing this file should trigger an incremental rebuild
  103. IncrementalBuildDependency : bool
  104. }
  105. type IncrementalBuilder =
  106. new : tcConfig : Build.TcConfig * projectDirectory : string * assemblyName : string * niceNameGen : Microsoft.FSharp.Compiler.Ast.NiceNameGenerator *
  107. lexResourceManager : Microsoft.FSharp.Compiler.Lexhelp.LexResourceManager * sourceFiles : string list * ensureReactive : bool *
  108. errorLogger : ErrorLogger * keepGeneratedTypedAssembly:bool
  109. -> IncrementalBuilder
  110. /// Increment the usage count on the IncrementalBuilder by 1. Ths initial usage count is 0. The returns an IDisposable which will
  111. /// decrement the usage count on the entire build by 1 and dispose if it is no longer used by anyone.
  112. member IncrementUsageCount : unit -> System.IDisposable
  113. /// Check if the builder is not disposed
  114. member IsAlive : bool
  115. /// The TcConfig passed in to the builder creation.
  116. member TcConfig : Build.TcConfig
  117. /// Raised just before a file is type-checked, to invalidate the state of the file in VS and force VS to request a new direct typecheck of the file.
  118. /// The incremental builder also typechecks the file (error and intellisense results from the backgroud builder are not
  119. /// used by VS).
  120. member BeforeTypeCheckFile : IEvent<string>
  121. /// Raised when a type provider invalidates the build.
  122. member ImportedCcusInvalidated : IEvent<string>
  123. /// The list of files the build depends on
  124. member Dependencies : FileDependency list
  125. #if EXTENSIONTYPING
  126. /// Whether there are any 'live' type providers that may need a refresh when a project is Cleaned
  127. member ThereAreLiveTypeProviders : bool
  128. #endif
  129. /// Perform one step in the F# build.
  130. member Step : unit -> bool
  131. /// Ensure that the given file has been typechecked.
  132. /// Get the preceding typecheck state of a slot, allow stale results.
  133. member GetAntecedentTypeCheckResultsBySlot :
  134. int -> (Build.TcState * Build.TcImports * Microsoft.FSharp.Compiler.Env.TcGlobals * Build.TcConfig * (PhasedError * bool) list * System.DateTime) option
  135. /// Get the final typecheck result. Only allowed when 'generateTypedImplFiles' was set on Create, otherwise the TypedAssembly will have not implementations.
  136. member TypeCheck : unit -> Build.TcState * TypeChecker.TopAttribs * Tast.TypedAssembly * TypeChecker.TcEnv * Build.TcImports * Env.TcGlobals * Build.TcConfig
  137. /// Attempts to find the slot of the given input file name. Throws an exception if it couldn't find it.
  138. member GetSlotOfFileName : string -> int
  139. #if NO_QUICK_SEARCH_HELPERS // only used in QuickSearch prototype
  140. #else
  141. /// Get the number of slots on the vector of parse results
  142. member GetSlotsCount : unit -> int
  143. /// Await the untyped parse results for a particular slot in the vector of parse results.
  144. member GetParseResultsBySlot : int -> Ast.ParsedInput option * Range.range * string
  145. #endif // QUICK_SEARCH
  146. static member CreateBackgroundBuilderForProjectOptions : scriptClosureOptions:LoadClosure option * sourceFiles:string list * commandLineArgs:string list * projectDirectory:string * useScriptResolutionRules:bool * isIncompleteTypeCheckEnvironment : bool -> IncrementalBuilder * ErrorInfo list