-
Notifications
You must be signed in to change notification settings - Fork 846
Add impl files to file check results #3659
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
Merged
dsyme
merged 7 commits into
dotnet:master
from
vasily-kirichenko:add-impl-files-to-file-check-results
Oct 2, 2017
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a318125
add LanguageServiceProfiling project to internals visible to list of …
vasily-kirichenko 57b00d1
add ImplementationFiles to FSharpCheckFileResults
vasily-kirichenko 7a765b7
make FSharpImplementationFileContents ctor internal
vasily-kirichenko 4f5b636
Merge remote-tracking branch 'origin/master' into add-impl-files-to-f…
8957418
throw if ImplementationFiles is called having keepAssemblyContents fl…
bec6fa8
add a test
vasily-kirichenko 187227b
spelling and cosmetics
vasily-kirichenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -163,7 +163,8 @@ type TypeCheckInfo | |
| loadClosure : LoadClosure option, | ||
| reactorOps : IReactorOperations, | ||
| checkAlive : (unit -> bool), | ||
| textSnapshotInfo:obj option) = | ||
| textSnapshotInfo:obj option, | ||
| implementationFiles: TypedImplFile list) = | ||
|
|
||
| let textSnapshotInfo = defaultArg textSnapshotInfo null | ||
| let (|CNR|) (cnr:CapturedNameResolution) = | ||
|
|
@@ -1356,6 +1357,8 @@ type TypeCheckInfo | |
| /// The assembly being analyzed | ||
| member __.ThisCcu = thisCcu | ||
|
|
||
| member __.ImplementationFiles = implementationFiles | ||
|
|
||
| override __.ToString() = "TypeCheckInfo(" + mainInputFileName + ")" | ||
|
|
||
|
|
||
|
|
@@ -1662,7 +1665,7 @@ module internal Parser = | |
| let errors = errHandler.CollectedDiagnostics | ||
|
|
||
| match tcEnvAtEndOpt with | ||
| | Some (tcEnvAtEnd, _typedImplFiles, tcState) -> | ||
| | Some (tcEnvAtEnd, typedImplFiles, tcState) -> | ||
| let scope = | ||
| TypeCheckInfo(tcConfig, tcGlobals, | ||
| tcState.PartialAssemblySignature, | ||
|
|
@@ -1678,7 +1681,8 @@ module internal Parser = | |
| loadClosure, | ||
| reactorOps, | ||
| checkAlive, | ||
| textSnapshotInfo) | ||
| textSnapshotInfo, | ||
| typedImplFiles) | ||
| return errors, TypeCheckAborted.No scope | ||
| | None -> | ||
| return errors, TypeCheckAborted.Yes | ||
|
|
@@ -1817,7 +1821,7 @@ type FSharpCheckProjectResults(projectFileName:string, keepAssemblyContents, err | |
| // | ||
| // There is an important property of all the objects returned by the methods of this type: they do not require | ||
| // the corresponding background builder to be alive. That is, they are simply plain-old-data through pre-formatting of all result text. | ||
| type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOptX: TypeCheckInfo option, dependencyFiles: string list, builderX: IncrementalBuilder option, reactorOpsX:IReactorOperations) = | ||
| type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOptX: TypeCheckInfo option, dependencyFiles: string list, builderX: IncrementalBuilder option, reactorOpsX:IReactorOperations, keepAssemblyContents: bool) = | ||
|
|
||
| // This may be None initially, or may be set to None when the object is disposed or finalized | ||
| let mutable details = match scopeOptX with None -> None | Some scopeX -> Some (scopeX, builderX, reactorOpsX) | ||
|
|
@@ -2002,6 +2006,12 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp | |
| RequireCompilationThread ctok | ||
| scope.IsRelativeNameResolvable(pos, plid, item)) | ||
|
|
||
| member info.ImplementationFiles = | ||
| if not keepAssemblyContents then invalidOp "The 'keepAssemblyContents' flag must be set to tru on the FSharpChecker in order to access the checked contents of assemblies" | ||
| scopeOptX | ||
|
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. Could you add this please
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. As for |
||
| |> Option.map (fun scope -> | ||
| let cenv = Impl.cenv(scope.TcGlobals, scope.ThisCcu, scope.TcImports) | ||
| [ for mimpl in scope.ImplementationFiles -> FSharpImplementationFileContents(cenv, mimpl)]) | ||
|
|
||
| override info.ToString() = "FSharpCheckFileResults(" + filename + ")" | ||
|
|
||
|
|
@@ -2326,7 +2336,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC | |
| static let mutable foregroundTypeCheckCount = 0 | ||
|
|
||
| let MakeCheckFileResultsEmpty(filename, creationErrors) = | ||
| FSharpCheckFileResults (filename, Array.ofList creationErrors, None, [], None, reactorOps) | ||
| FSharpCheckFileResults (filename, Array.ofList creationErrors, None, [], None, reactorOps, keepAssemblyContents) | ||
|
|
||
| let MakeCheckFileResults(filename, options:FSharpProjectOptions, builder, scope, dependencyFiles, creationErrors, parseErrors, tcErrors) = | ||
| let errors = | ||
|
|
@@ -2337,7 +2347,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC | |
| else | ||
| yield! tcErrors |] | ||
|
|
||
| FSharpCheckFileResults (filename, errors, Some scope, dependencyFiles, Some builder, reactorOps) | ||
| FSharpCheckFileResults (filename, errors, Some scope, dependencyFiles, Some builder, reactorOps, keepAssemblyContents) | ||
|
|
||
| let MakeCheckFileAnswer(filename, tcFileResult, options:FSharpProjectOptions, builder, dependencyFiles, creationErrors, parseErrors, tcErrors) = | ||
| match tcFileResult with | ||
|
|
@@ -2624,7 +2634,8 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC | |
| List.last tcProj.TcResolutions, | ||
| List.last tcProj.TcSymbolUses, | ||
| tcProj.TcEnvAtEnd.NameEnv, | ||
| loadClosure, reactorOps, (fun () -> builder.IsAlive), None) | ||
| loadClosure, reactorOps, (fun () -> builder.IsAlive), None, | ||
| tcProj.ImplementationFiles) | ||
| let typedResults = MakeCheckFileResults(filename, options, builder, scope, tcProj.TcDependencyFiles, creationErrors, parseResults.Errors, tcErrors) | ||
| return (parseResults, typedResults) | ||
| }) | ||
|
|
@@ -3144,7 +3155,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, reactorOps: IReactorOperatio | |
| match tcFileResult with | ||
| | Parser.TypeCheckAborted.No scope -> | ||
| let errors = [| yield! parseErrors; yield! tcErrors |] | ||
| let typeCheckResults = FSharpCheckFileResults (filename, errors, Some scope, dependencyFiles, None, reactorOps) | ||
| let typeCheckResults = FSharpCheckFileResults (filename, errors, Some scope, dependencyFiles, None, reactorOps, false) | ||
| let projectResults = FSharpCheckProjectResults (filename, keepAssemblyContents, errors, Some(tcGlobals, tcImports, scope.ThisCcu, scope.CcuSig, [scope.ScopeSymbolUses], None, None, mkSimpleAssRef "stdin", tcState.TcEnvFromImpls.AccessRights, None, dependencyFiles), reactorOps) | ||
| parseResults, typeCheckResults, projectResults | ||
| | _ -> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A typo in
true.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done.