PageRenderTime 45ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/compiler/3.0/Sep2012/src/fsharp/vs/IncrementalBuild.fsi

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