Skip to content

Commit 66f7ed7

Browse files
committed
add to signature file
1 parent 236037e commit 66f7ed7

File tree

7 files changed

+18
-10
lines changed

7 files changed

+18
-10
lines changed

docs/content/queue.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sequentially and in order.
1111
1212
The thread processing these requests can also run a low-priority, interleaved background operation when the
1313
queue is empty. This can be used to implicitly bring the background check of a project "up-to-date".
14-
When the operations queue has been empty for 1 second ,
14+
When the operations queue has been empty for 2 seconds,
1515
this background work is run in small incremental fragments. This work is cooperatively time-sliced to be approximately <50ms, (see `maxTimeShareMilliseconds` in
1616
IncrementalBuild.fs). The project to be checked in the background is set implicitly
1717
by calls to ``CheckFileInProject`` and ``ParseAndCheckFileInProject``.

src/fsharp/fsc.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,15 +615,15 @@ type ILResource with
615615
| ILResourceLocation.Local b -> b()
616616
| _-> error(InternalError("Bytes",rangeStartup))
617617

618-
let EncodeInterfaceData(tcConfig:TcConfig,tcGlobals,exportRemapping,generatedCcu,outfile) =
618+
let EncodeInterfaceData(tcConfig:TcConfig,tcGlobals,exportRemapping,generatedCcu,outfile,isIncrementalBuild) =
619619
if GenerateInterfaceData(tcConfig) then
620620
if verbose then dprintfn "Generating interface data attribute...";
621621
let resource = WriteSignatureData (tcConfig,tcGlobals,exportRemapping,generatedCcu,outfile)
622622
if verbose then dprintf "Generated interface data attribute!\n";
623623
// REVIEW: need a better test for this
624624
let outFileNoExtension = Filename.chopExtension outfile
625625
let isCompilerServiceDll = outFileNoExtension.Contains("FSharp.LanguageService.Compiler")
626-
if tcConfig.useOptimizationDataFile || tcGlobals.compilingFslib || isCompilerServiceDll then
626+
if (tcConfig.useOptimizationDataFile || tcGlobals.compilingFslib || isCompilerServiceDll) && not isIncrementalBuild then
627627
let sigDataFileName = (Filename.chopExtension outfile)+".sigdata"
628628
File.WriteAllBytes(sigDataFileName,resource.Bytes);
629629
let sigAttr = mkSignatureDataVersionAttr tcGlobals (IL.parseILVersion Internal.Utilities.FSharpEnvironment.FSharpBinaryMetadataFormatRevision)
@@ -1917,7 +1917,7 @@ let main2(Args(tcConfig, tcImports, frameworkTcImports: TcImports, tcGlobals, er
19171917

19181918
let sigDataAttributes,sigDataResources =
19191919
try
1920-
EncodeInterfaceData(tcConfig, tcGlobals, exportRemapping, generatedCcu, outfile)
1920+
EncodeInterfaceData(tcConfig, tcGlobals, exportRemapping, generatedCcu, outfile, false)
19211921
with e ->
19221922
errorRecoveryNoRange e
19231923
SqmLoggerWithConfig tcConfig errorLogger.ErrorNumbers errorLogger.WarningNumbers

src/fsharp/fsc.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type ErrorLoggerProvider =
2121

2222
type SigningInfo = SigningInfo of (* delaysign:*) bool * (*signer:*) string option * (*container:*) string option
2323

24-
val EncodeInterfaceData: tcConfig:TcConfig * tcGlobals:TcGlobals * exportRemapping:Tastops.Remap * generatedCcu: Tast.CcuThunk * outfile: string -> ILAttribute list * ILResource list
24+
val EncodeInterfaceData: tcConfig:TcConfig * tcGlobals:TcGlobals * exportRemapping:Tastops.Remap * generatedCcu: Tast.CcuThunk * outfile: string * isIncrementalBuild: bool -> ILAttribute list * ILResource list
2525
val ValidateKeySigningAttributes : tcConfig:TcConfig * tcGlobals:TcGlobals * TypeChecker.TopAttribs -> SigningInfo
2626
val GetSigner : SigningInfo -> ILBinaryWriter.ILStrongNameSigner option
2727

src/fsharp/vs/IncrementalBuild.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ module internal IncrementalFSharpBuild =
15001500
let exportRemapping = MakeExportRemapping generatedCcu generatedCcu.Contents
15011501

15021502
let sigData =
1503-
let _sigDataAttributes,sigDataResources = Driver.EncodeInterfaceData(tcConfig,tcGlobals,exportRemapping,generatedCcu,outfile)
1503+
let _sigDataAttributes,sigDataResources = Driver.EncodeInterfaceData(tcConfig,tcGlobals,exportRemapping,generatedCcu,outfile,true)
15041504
[ for r in sigDataResources do
15051505
let ccuName = GetSignatureDataResourceName r
15061506
let bytes =

src/fsharp/vs/Reactor.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module internal Reactor =
3131
/// are open.
3232
type Reactor() =
3333
static let GetEnvInteger e dflt = match System.Environment.GetEnvironmentVariable(e) with null -> dflt | t -> try int t with _ -> dflt
34-
static let pauseBeforeBackgroundWorkDefault = GetEnvInteger "FCS_PauseBeforeBackgroundWorkMilliseconds" 1000
34+
static let pauseBeforeBackgroundWorkDefault = GetEnvInteger "FCS_PauseBeforeBackgroundWorkMilliseconds" 2000
3535
let mutable pauseBeforeBackgroundWork = pauseBeforeBackgroundWorkDefault
3636

3737
// We need to store the culture for the VS thread that is executing now,

src/fsharp/vs/service.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2659,7 +2659,6 @@ type BackgroundCompiler(projectCacheSize, keepAssemblyContents, keepAllBackgroun
26592659

26602660
member __.FrameworkImportsCache = frameworkTcImportsCache
26612661
member __.ImplicitlyStartBackgroundWork with get() = implicitlyStartBackgroundWork and set v = implicitlyStartBackgroundWork <- v
2662-
member __.PauseBeforeBackgroundWork with get() = Reactor.Reactor().PauseBeforeBackgroundWork and set v = Reactor.Reactor().PauseBeforeBackgroundWork <- v
26632662
static member GlobalForegroundParseCountStatistic = foregroundParseCount
26642663
static member GlobalForegroundTypeCheckCountStatistic = foregroundTypeCheckCount
26652664

@@ -3196,6 +3195,7 @@ type FSharpChecker(projectCacheSize, keepAssemblyContents, keepAllBackgroundReso
31963195
member ic.FileChecked = backgroundCompiler.FileChecked
31973196
member ic.ProjectChecked = backgroundCompiler.ProjectChecked
31983197
member ic.ImplicitlyStartBackgroundWork with get() = backgroundCompiler.ImplicitlyStartBackgroundWork and set v = backgroundCompiler.ImplicitlyStartBackgroundWork <- v
3198+
member ic.PauseBeforeBackgroundWork with get() = Reactor.Reactor().PauseBeforeBackgroundWork and set v = Reactor.Reactor().PauseBeforeBackgroundWork <- v
31993199

32003200
static member GlobalForegroundParseCountStatistic = BackgroundCompiler.GlobalForegroundParseCountStatistic
32013201
static member GlobalForegroundTypeCheckCountStatistic = BackgroundCompiler.GlobalForegroundTypeCheckCountStatistic

src/fsharp/vs/service.fsi

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,12 @@ type FSharpChecker =
626626
/// For example, dependent references may have been deleted or created.
627627
member InvalidateConfiguration: options: FSharpProjectOptions -> unit
628628

629-
/// Begin background parsing the given project.
629+
[<Obsolete("This method has been renamed to CheckProjectInBackground")>]
630630
member StartBackgroundCompile: options: FSharpProjectOptions -> unit
631631

632+
/// Set the project to be checked in the background. Overrides any previous call to <c>CheckProjectInBackground</c>
633+
member CheckProjectInBackground: options: FSharpProjectOptions -> unit
634+
632635
/// Stop the background compile.
633636
[<Obsolete("Explicitly stopping background compilation is not recommended and the functionality to allow this may be rearchitected in future release. If you use this functionality please add an issue on http://github.com/fsharp/FSharp.Compiler.Service describing how you use it and ignore this warning.")>]
634637
member StopBackgroundCompile : unit -> unit
@@ -676,11 +679,16 @@ type FSharpChecker =
676679
/// A maximum number of megabytes of allocated memory. If the figure reported by <c>System.GC.GetTotalMemory(false)</c> goes over this limit, the FSharpChecker object will attempt to free memory and reduce cache sizes to a minimum.</param>
677680
member MaxMemory : int with get, set
678681
679-
/// If true, then calls to CheckFileInProject implicitly start a background check of that project, replacing
682+
/// Get or set a flag which controls if background work is started implicitly.
683+
///
684+
/// If true, calls to CheckFileInProject implicitly start a background check of that project, replacing
680685
/// any other background checks in progress. This is useful in IDE applications with spare CPU cycles as
681686
/// it prepares the project analysis results for use. The default is 'true'.
682687
member ImplicitlyStartBackgroundWork: bool with get, set
683688
689+
/// Get or set the pause time in milliseconds before background work is started.
690+
member PauseBeforeBackgroundWork: bool with get, set
691+
684692
[<Obsolete("Renamed to BeforeBackgroundFileCheck")>]
685693
member FileTypeCheckStateIsDirty : IEvent<string>
686694

0 commit comments

Comments
 (0)