FCS: add FSharpCheckFileResults.FileSignature - #20478
Open
auduchinok wants to merge 3 commits into
Open
Conversation
Contributor
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev
|
T-Gro
reviewed
Sep 9, 2026
| tcDiagnostics, | ||
| keepAssemblyContents, | ||
| Option.get latestCcuSigForFile, | ||
| Option.get latestOwnSigForFile, |
Member
There was a problem hiding this comment.
🤖 🕵️ Background FileSignature drops declarations hidden by .fsi with the legacy checker, even though its symbol uses contain those definitions. This needs the fully checked implementation signature rather than the skipped-file placeholder.
// Test.fsi
module Test
val visible: int
// Test.fs
module Test
let hidden = 41
let visible = hidden + 1
// FCS client, with project options for these files:
let checker =
FSharpChecker.Create(useTransparentCompiler = false,
keepAllBackgroundResolutions = true)
let _, result =
checker.GetBackgroundCheckResultsForFileInProject(testFs, options)
|> Async.RunSynchronously
let test = result.FileSignature.FindEntityByPath ["Test"] |> Option.get
test.MembersFunctionsAndValues |> Seq.map _.DisplayName |> Seq.toList
// ["visible"]; foreground and transparent checking return ["hidden"; "visible"].| FSharpAssemblySignature(g, thisCcu, ccuSigForFile, tcImports, None, ccuSigForFile) | ||
|
|
||
| member _.FileSignature = | ||
| FSharpAssemblySignature(g, thisCcu, ccuSigForFile, tcImports, None, ownSigForFile) |
Member
There was a problem hiding this comment.
🤖 🕵️ Hidden nested types lose their declaring module: DeclaringEntity returns None in both checker modes although the parent is present in FileSignature. The symbol-resolution context needs the inferred contents too; the exported CCU signature cannot resolve that parent.
// Test.fsi
module Test
val visible: int
// Test.fs
module Test
let visible = 1
module Hidden =
type Secret<'T> = { Item: 'T }
// FCS client, after checking Test.fs:
let hidden =
result.FileSignature.FindEntityByPath ["Test"; "Hidden"]
|> Option.get
hidden.NestedEntities[0].DeclaringEntity
// None; without Test.fsi this is Some Test.Hidden.
T-Gro
self-requested a review
September 9, 2026 09:04
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #3259. Adds access to the file own signature, including memers hidden fsi file.