-
Notifications
You must be signed in to change notification settings - Fork 831
[Tooling Optimization] Skip background type-checking on implementation files if signature files exist #10199
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
Changes from all commits
13aa2e0
2368052
300664c
f158eaa
e83ebda
62c0519
00a35bc
db4f018
92c7cc8
4c3c258
46b1117
33481c2
315be1f
116b0b7
3fa36f6
79db9ed
8350e37
75f8099
7be6e07
57611bc
29d25f2
be77e72
6d29b09
ef9149d
ab54e62
8f16c45
8413844
1087972
c48217b
0b7ae6c
36dcf61
2db6f8d
a72a321
901712d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -576,7 +576,7 @@ type TcState = | |
|
|
||
| member x.NextStateAfterIncrementalFragment tcEnvAtEndOfLastInput = | ||
| { x with tcsTcSigEnv = tcEnvAtEndOfLastInput | ||
| tcsTcImplEnv = tcEnvAtEndOfLastInput } | ||
| tcsTcImplEnv = tcEnvAtEndOfLastInput } | ||
|
|
||
|
|
||
| /// Create the initial type checking state for compiling an assembly | ||
|
|
@@ -621,7 +621,7 @@ let GetInitialTcState(m, ccuName, tcConfig: TcConfig, tcGlobals, tcImports: TcIm | |
| tcsCcuSig = Construct.NewEmptyModuleOrNamespaceType Namespace } | ||
|
|
||
| /// Typecheck a single file (or interactive entry into F# Interactive) | ||
| let TypeCheckOneInputEventually (checkForErrors, tcConfig: TcConfig, tcImports: TcImports, tcGlobals, prefixPathOpt, tcSink, tcState: TcState, inp: ParsedInput) = | ||
| let TypeCheckOneInputEventually (checkForErrors, tcConfig: TcConfig, tcImports: TcImports, tcGlobals, prefixPathOpt, tcSink, tcState: TcState, inp: ParsedInput, skipImplIfSigExists: bool) = | ||
|
|
||
| eventually { | ||
| try | ||
|
|
@@ -686,11 +686,21 @@ let TypeCheckOneInputEventually (checkForErrors, tcConfig: TcConfig, tcImports: | |
| let conditionalDefines = | ||
| if tcConfig.noConditionalErasure then None else Some (tcConfig.conditionalCompilationDefines) | ||
|
|
||
| let hadSig = rootSigOpt.IsSome | ||
|
|
||
| // Typecheck the implementation file | ||
| let! topAttrs, implFile, _implFileHiddenType, tcEnvAtEnd, createsGeneratedProvidedTypes = | ||
| TypeCheckOneImplFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, conditionalDefines, tcSink, tcConfig.internalTestSpanStackReferring) tcImplEnv rootSigOpt file | ||
| let typeCheckOne = | ||
| if skipImplIfSigExists && hadSig then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just out of curiosity, is hadsig the right name? It seems as if it should be hasSig.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Honestly, The most accurate name would be |
||
| let dummyExpr = ModuleOrNamespaceExprWithSig.ModuleOrNamespaceExprWithSig(rootSigOpt.Value, ModuleOrNamespaceExpr.TMDefs [], range.Zero) | ||
| let dummyImplFile = TypedImplFile.TImplFile(qualNameOfFile, [], dummyExpr, false, false, StampMap []) | ||
|
|
||
| (EmptyTopAttrs, dummyImplFile, Unchecked.defaultof<_>, tcImplEnv, false) | ||
| |> Eventually.Done | ||
| else | ||
| TypeCheckOneImplFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, conditionalDefines, tcSink, tcConfig.internalTestSpanStackReferring) tcImplEnv rootSigOpt file | ||
|
|
||
| let! topAttrs, implFile, _implFileHiddenType, tcEnvAtEnd, createsGeneratedProvidedTypes = typeCheckOne | ||
|
|
||
| let hadSig = rootSigOpt.IsSome | ||
| let implFileSigType = SigTypeOfImplFile implFile | ||
|
|
||
| let rootImpls = Zset.add qualNameOfFile tcState.tcsRootImpls | ||
|
|
@@ -741,7 +751,7 @@ let TypeCheckOneInput (ctok, checkForErrors, tcConfig, tcImports, tcGlobals, pre | |
| // 'use' ensures that the warning handler is restored at the end | ||
| use unwindEL = PushErrorLoggerPhaseUntilUnwind(fun oldLogger -> GetErrorLoggerFilteringByScopedPragmas(false, GetScopedPragmasForInput inp, oldLogger) ) | ||
| use unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.TypeCheck | ||
| TypeCheckOneInputEventually (checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, TcResultsSink.NoSink, tcState, inp) | ||
| TypeCheckOneInputEventually (checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, TcResultsSink.NoSink, tcState, inp, false) | ||
| |> Eventually.force ctok | ||
|
|
||
| /// Finish checking multiple files (or one interactive entry into F# Interactive) | ||
|
|
@@ -756,7 +766,7 @@ let TypeCheckMultipleInputsFinish(results, tcState: TcState) = | |
| let TypeCheckOneInputAndFinishEventually(checkForErrors, tcConfig: TcConfig, tcImports, tcGlobals, prefixPathOpt, tcSink, tcState, input) = | ||
| eventually { | ||
| Logger.LogBlockStart LogCompilerFunctionId.CompileOps_TypeCheckOneInputAndFinishEventually | ||
| let! results, tcState = TypeCheckOneInputEventually(checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcSink, tcState, input) | ||
| let! results, tcState = TypeCheckOneInputEventually(checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcSink, tcState, input, false) | ||
| let result = TypeCheckMultipleInputsFinish([results], tcState) | ||
| Logger.LogBlockStop LogCompilerFunctionId.CompileOps_TypeCheckOneInputAndFinishEventually | ||
| return result | ||
|
|
@@ -779,4 +789,3 @@ let TypeCheckClosedInputSet (ctok, checkForErrors, tcConfig, tcImports, tcGlobal | |
| let (tcEnvAtEndOfLastFile, topAttrs, implFiles, _), tcState = TypeCheckMultipleInputsFinish(results, tcState) | ||
| let tcState, declaredImpls = TypeCheckClosedInputSetFinish (implFiles, tcState) | ||
| tcState, topAttrs, declaredImpls, tcEnvAtEndOfLastFile | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.