Skip to content
Open
Show file tree
Hide file tree
Changes from 133 commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
f6cad50
Add Roslyn-format EnC CustomDebugInformation codec and portable PDB m…
NatElkins Jul 1, 2026
0d02145
Use ProcessStartInfo.Arguments for net472 compatibility
NatElkins Jul 1, 2026
66a1412
Make the EnC CDI test module public for xunit v3 discovery
NatElkins Jul 2, 2026
c8639f3
Extract stable synthesized-name replay layer
NatElkins Jul 2, 2026
d6319c1
Add ECMA-335 EnC metadata delta writer
NatElkins Jul 1, 2026
b0a487f
Add typed-tree diff slice for hot reload
NatElkins Jul 2, 2026
d505ab9
Fix generated-name scope test in stable names slice
NatElkins Jul 8, 2026
7aaacc5
Fix EnC CDI cross-validation test process launch on Desktop and bare …
NatElkins Jul 3, 2026
c78b2f6
Remove extra EOF blank line in delta metadata tests
NatElkins Jul 8, 2026
2facaf2
Merge branch 'refresh/20260717/hotreload-typedtree-diff' into refresh…
NatElkins Jul 17, 2026
cd1339b
Merge branch 'refresh/20260717/hotreload-stable-names' into refresh/2…
NatElkins Jul 17, 2026
ba5bce9
Merge branch 'refresh/20260717/enc-metadata-delta-writer' into refres…
NatElkins Jul 17, 2026
c23986b
Add hot reload baseline reader state
NatElkins Jul 3, 2026
ac6a1ba
Extract hot reload delta emitter
NatElkins Jul 3, 2026
11e8fa0
Fix synthesized-name snapshot assertions to use the array equality ov…
NatElkins Jul 3, 2026
b228654
Align the signature-change diff test with the evolved differ classifi…
NatElkins Jul 3, 2026
3e1678d
Validate hot reload baseline metadata inputs
NatElkins Jul 17, 2026
5fdf705
Enforce cumulative metadata delta invariants
NatElkins Jul 17, 2026
c584660
Validate hot reload generated names before classification
NatElkins Jul 17, 2026
9a9211e
Validate hot reload baseline metadata inputs
NatElkins Jul 17, 2026
be6df7b
Preserve reviewed lower-slice invariants in delta emitter
NatElkins Jul 17, 2026
8932904
Unify delta emission on the shared metadata writer
NatElkins Jul 17, 2026
d40f0bc
Fail closed on unresolved accessor metadata
NatElkins Jul 17, 2026
11b50cc
Extract hot reload session slice
NatElkins Jul 3, 2026
36ef5ba
Fix CI compile breaks and extraction debris in the session slice tests
NatElkins Jul 3, 2026
330761c
Fix net472 and CI-image portability breaks in session slice tests
NatElkins Jul 3, 2026
a886637
Drop the netcore-only Contains overload from delta builder tests
NatElkins Jul 3, 2026
9bb2547
Gate the Roslyn baseline comparison tests to .NET Core
NatElkins Jul 3, 2026
6420b62
Normalize fixture line endings before update-source splicing
NatElkins Jul 3, 2026
c67ec56
Update ilxgen name-path architecture guard
NatElkins Jul 8, 2026
a4b8616
Remove duplicate delta metadata test copies
NatElkins Jul 8, 2026
4a1efa4
Remove duplicate compiler global reset member
NatElkins Jul 8, 2026
7216294
Remove duplicate compiler global reset signature
NatElkins Jul 8, 2026
2b461a8
Repair session slice after metadata writer consolidation
NatElkins Jul 17, 2026
9bf2891
Make hot reload session updates transactional
NatElkins Jul 17, 2026
9112dab
Report hot reload update capabilities
NatElkins Jul 17, 2026
21dbd06
Report hot reload update capabilities
NatElkins Jul 17, 2026
b26df0f
Expose required hot reload capabilities
NatElkins Jul 17, 2026
490f458
Document F# hot reload rude-edit diagnostics
NatElkins Jul 17, 2026
16b0de1
Format delta metadata writer sources
NatElkins Jul 17, 2026
a402010
Format delta metadata writer sources
NatElkins Jul 17, 2026
24f4879
Format hot reload compiler sources
NatElkins Jul 17, 2026
34950ea
Format hot reload compiler sources
NatElkins Jul 17, 2026
733a531
Format hot reload compiler sources
NatElkins Jul 17, 2026
1248503
Format hot reload emitter sources
NatElkins Jul 17, 2026
254b36c
Format hot reload session sources
NatElkins Jul 17, 2026
4768d1b
Retry CI after Linux runner memory exhaustion
NatElkins Jul 18, 2026
bdb1d28
Add typed-tree diff slice for hot reload
NatElkins Jul 2, 2026
1a5c97e
Make typed-tree diff classification fail closed
NatElkins Jul 17, 2026
f7dd5dd
Format hot reload compiler sources
NatElkins Jul 17, 2026
c2d4c86
Add ECMA-335 EnC metadata delta writer
NatElkins Jul 1, 2026
83696d2
Remove extra EOF blank line in delta metadata tests
NatElkins Jul 8, 2026
6cc71de
Enforce cumulative metadata delta invariants
NatElkins Jul 17, 2026
7e2770f
Format delta metadata writer sources
NatElkins Jul 17, 2026
078961d
Retry CI after regression job timeout
NatElkins Jul 18, 2026
33fceef
Share delta user string encoding and trace configuration
NatElkins Jul 22, 2026
0e55c15
Harden hot reload session capture and file handling
NatElkins Jul 22, 2026
ad6c411
Merge remote-tracking branch 'origin/main' into refresh/20260717/hotr…
NatElkins Jul 22, 2026
e981e30
Handle metadata-only methods in PDB ambiguity checks
NatElkins Jul 22, 2026
1f7a82b
Share delta user string encoding and trace configuration
NatElkins Jul 22, 2026
06378d5
Make synthesized name snapshots deterministic
NatElkins Jul 22, 2026
6129dda
Harden typed-tree diff classification
NatElkins Jul 22, 2026
4ad2364
Harden baseline metadata parsing
NatElkins Jul 22, 2026
88c0c62
Merge remote-tracking branch 'origin/main' into refresh/20260717/hotr…
NatElkins Jul 22, 2026
9dad496
Handle metadata-only methods in PDB ambiguity checks
NatElkins Jul 22, 2026
e7531a7
Make synthesized name snapshots deterministic
NatElkins Jul 22, 2026
eaaf64e
Harden typed-tree diff classification
NatElkins Jul 22, 2026
2491370
Harden baseline metadata parsing
NatElkins Jul 22, 2026
ac42fbf
Harden delta metadata identity and cleanup
NatElkins Jul 22, 2026
2aefa5f
Merge remote-tracking branch 'origin/main' into refresh/20260717/hotr…
NatElkins Jul 22, 2026
17f464f
Handle metadata-only methods in PDB ambiguity checks
NatElkins Jul 22, 2026
25eca5c
Share delta user string encoding and trace configuration
NatElkins Jul 22, 2026
98aeadb
Make synthesized name snapshots deterministic
NatElkins Jul 22, 2026
e84c143
Harden typed-tree diff classification
NatElkins Jul 22, 2026
2a827b0
Harden baseline metadata parsing
NatElkins Jul 22, 2026
01d19b1
Harden delta metadata identity and cleanup
NatElkins Jul 22, 2026
118edc8
Ignore transient provider scopes in body identity
NatElkins Jul 22, 2026
eb661b3
Ignore transient provider scopes in body identity
NatElkins Jul 22, 2026
e3e089d
Bound decision-tree identity traversal
NatElkins Jul 23, 2026
7ffe458
Bound baseline string heap reads
NatElkins Jul 23, 2026
42d29eb
Bound decision-tree identity traversal
NatElkins Jul 23, 2026
0b44ec4
Fail closed on closure-name recapture mismatch
NatElkins Jul 23, 2026
7b00822
Bound baseline string heap reads
NatElkins Jul 23, 2026
ec0f30b
Bound decision-tree identity traversal
NatElkins Jul 23, 2026
f2d7c1e
Bound baseline string heap reads
NatElkins Jul 23, 2026
a052db3
Format bounded string heap reader
NatElkins Jul 23, 2026
474bbef
Format bounded string heap reader
NatElkins Jul 23, 2026
9f6a761
Make closure recapture test deterministic
NatElkins Jul 23, 2026
e5d6392
Merge remote-tracking branch 'origin/main' into refresh/20260717/hotr…
NatElkins Jul 23, 2026
54cd67d
Merge branch 'main' into enc-metadata-delta-writer
T-Gro Jul 24, 2026
62df5dc
Merge branch 'main' into hotreload-typedtree-diff
T-Gro Jul 24, 2026
8d28083
Merge remote-tracking branch 'origin/main' into refresh/20260717/enc-…
NatElkins Jul 24, 2026
b492d58
Merge remote-tracking branch 'origin/main' into refresh/20260717/hotr…
NatElkins Jul 24, 2026
ead308d
Merge remote-tracking branch 'origin/main' into refresh/20260717/hotr…
NatElkins Jul 24, 2026
7622b7e
Merge remote-tracking branch 'origin/main' into refresh/20260717/hotr…
NatElkins Jul 24, 2026
c83b6ab
Complete hot reload merge integration
NatElkins Jul 24, 2026
6c7a61b
Fix compiled baseline metadata table parsing
NatElkins Jul 24, 2026
4386ab1
Update delta metadata test writer options
NatElkins Jul 24, 2026
e0a38af
Complete baseline reader merge integration
NatElkins Jul 24, 2026
e1d6a50
Merge branch 'refresh/20260717/enc-metadata-delta-writer' into refres…
NatElkins Jul 24, 2026
3ce3b14
Merge branch 'refresh/20260717/hotreload-typedtree-diff' into refresh…
NatElkins Jul 24, 2026
b994397
Merge branch 'refresh/20260717/hotreload-baseline-reader' into refres…
NatElkins Jul 24, 2026
cf0202c
Merge branch 'refresh/20260717/hotreload-delta-emitter' into refresh/…
NatElkins Jul 24, 2026
469a3b2
Complete session merge integration
NatElkins Jul 24, 2026
5b12365
Deduplicate merged compiler source entries
NatElkins Jul 24, 2026
4c0bba2
Merge branch 'refresh/20260717/hotreload-delta-emitter' into refresh/…
NatElkins Jul 24, 2026
000171d
Remove obsolete baseline reader copy
NatElkins Jul 24, 2026
e9b19d1
Merge branch 'refresh/20260717/hotreload-delta-emitter' into refresh/…
NatElkins Jul 24, 2026
a34afbc
Renumber hot reload driver diagnostics
NatElkins Jul 24, 2026
0ad1dce
Place baseline reader release note in current FCS notes
NatElkins Jul 24, 2026
47e92ee
Merge refreshed baseline reader release note
NatElkins Jul 24, 2026
5bdb691
Deduplicate composite release notes
NatElkins Jul 24, 2026
88053ca
Merge refreshed delta emitter release notes
NatElkins Jul 24, 2026
1511b10
Give session slice a single current release note
NatElkins Jul 24, 2026
238ebb6
Keep hot reload diagnostics sorted
NatElkins Jul 24, 2026
06e0ad8
Merge current main
NatElkins Jul 24, 2026
e56776f
Merge current main
NatElkins Jul 24, 2026
6218916
Merge current main
NatElkins Jul 24, 2026
2ec1bd2
Merge refreshed enc-metadata-delta-writer
NatElkins Jul 24, 2026
5f359e8
Merge refreshed hotreload-typedtree-diff
NatElkins Jul 24, 2026
b2642b8
Merge refreshed hotreload-baseline-reader
NatElkins Jul 24, 2026
ea8c3d3
Merge refreshed delta emitter
NatElkins Jul 24, 2026
f9be8ba
Merge remote-tracking branch 'origin/main' into merge/20260806/hotrel…
NatElkins Aug 6, 2026
c156e15
Merge remote-tracking branch 'origin/main' into merge/20260806/hotrel…
NatElkins Aug 6, 2026
169c41c
Merge branch 'merge/20260806/hotreload-baseline-reader' into merge/20…
NatElkins Aug 6, 2026
ea862ec
Merge branch 'merge/20260806/hotreload-typedtree-diff' into merge/202…
NatElkins Aug 6, 2026
ed3decb
Remove duplicated delta metadata compile entries after main merge
NatElkins Aug 6, 2026
aad5b56
Drop null match on Path.ChangeExtension result for new nullness rules
NatElkins Aug 6, 2026
b78ffd6
Use Async.RunSynchronouslyImmediate after test helper removal
NatElkins Aug 6, 2026
d04bd1a
Merge branch 'merge/20260806/hotreload-typedtree-diff' into merge/202…
NatElkins Aug 6, 2026
a259542
Merge branch 'merge/20260806/hotreload-delta-emitter' into merge/2026…
NatElkins Aug 6, 2026
2b16c6c
Use Async.RunSynchronouslyImmediate after test helper removal
NatElkins Aug 6, 2026
f222ff4
Drop null handling on Path.ChangeExtension results for new nullness r…
NatElkins Aug 6, 2026
b603728
Merge remote-tracking branch 'origin/main' into merge/20260806/hotrel…
NatElkins Aug 14, 2026
76b28e8
Merge remote-tracking branch 'origin/main' into merge/20260806/hotrel…
NatElkins Aug 14, 2026
34fc19a
Merge branch 'merge/20260806/hotreload-typedtree-diff' into merge/202…
NatElkins Aug 14, 2026
5654049
Remove baseline reader entries duplicated by the merged baseline slice
NatElkins Aug 14, 2026
98001b2
Merge branch 'merge/20260806/hotreload-delta-emitter' into merge/2026…
NatElkins Aug 14, 2026
af22915
Merge current compiler changes into the hot reload session
NatElkins Sep 25, 2026
f5490d5
Merge current main into the typed-tree diff slice
NatElkins Sep 25, 2026
de2069f
Merge current main into the delta emitter slice
NatElkins Sep 25, 2026
3e6f5d8
Use the public calling convention properties
NatElkins Sep 25, 2026
149da1c
Use the public calling convention properties
NatElkins Sep 25, 2026
e6582e4
Keep independent hot reload baselines for long output options
NatElkins Sep 25, 2026
9b49030
Detect hot reload metadata edits without body bindings
NatElkins Sep 25, 2026
7e69254
Merge the refreshed typed-tree diff and preserve capability classific…
NatElkins Sep 25, 2026
bd33519
Allocate resumption metadata only for hot reload capture
NatElkins Sep 25, 2026
22abc46
Assert resolved output identifiers for independent hot reload sessions
NatElkins Sep 25, 2026
6dd9edd
Keep intrinsic parameter identities stable across compilations
NatElkins Sep 25, 2026
450a42a
Preserve original metadata identities in disk hot reload sessions
NatElkins Sep 25, 2026
740046e
Use the repository SDK for metadata validation fixtures
NatElkins Sep 25, 2026
30cf2f7
Merge refreshed delta emitter dependencies into hot reload sessions
NatElkins Sep 25, 2026
b66ae91
Adapt inherited typed tree regressions to the session test module
NatElkins Sep 25, 2026
79e39a7
Validate emitted deltas and preserve native pointer identities
NatElkins Sep 25, 2026
caa5bb9
Distinguish the inherited ParamArray regression name
NatElkins Sep 25, 2026
675092f
Track emitted extension receiver metadata
NatElkins Sep 25, 2026
4c605c7
Isolate disk-start fixtures from previous capture sessions
NatElkins Sep 25, 2026
125e0c9
Match extension method metadata to emitted signatures
NatElkins Sep 25, 2026
bd97f70
Merge refreshed typed-tree receiver metadata detection
NatElkins Sep 25, 2026
feaecf0
Merge validated metadata and extension receiver fixes
NatElkins Sep 25, 2026
ac66be4
Verify extension receiver parameter updates through runtime apply
NatElkins Sep 25, 2026
38a64c0
Report metadata validator failures instead of skipping them
NatElkins Sep 25, 2026
b244ee3
Set explicit capabilities in inherited parameter rename regressions
NatElkins Sep 25, 2026
b4c1b83
Reject runtime async implementation transitions during hot reload
NatElkins Sep 25, 2026
ec1c2a4
Merge final emitter validation and runtime async safeguards
NatElkins Sep 25, 2026
57e2fea
Clarify the runtime async restart requirement
NatElkins Sep 25, 2026
507232d
Merge final runtime async documentation
NatElkins Sep 25, 2026
7234a30
Merge main and isolate hot reload captures by output
NatElkins Oct 27, 2026
caa6c48
Keep tracked input probes inside hot reload sessions
NatElkins Oct 27, 2026
4ddbd37
Match Roslyn parameter associations in hot reload deltas
NatElkins Oct 27, 2026
61bf359
Address historical hot reload review feedback
NatElkins Oct 27, 2026
a49dcb4
Separate declaration matching and added-definition row preparation
NatElkins Oct 27, 2026
aaa9563
Avoid redundant snapshots when committing hot reload sessions
NatElkins Oct 29, 2026
db76b9a
Allocate local value identities only when needed
NatElkins Oct 29, 2026
d37f267
Remove redundant canonical path length check
NatElkins Oct 29, 2026
debd77c
Check module storage before comparing initializer bodies
NatElkins Oct 29, 2026
7af9eec
Compare sequence points without a temporary pair list
NatElkins Oct 29, 2026
178a8a3
Find line-shift bounds without projected lists
NatElkins Oct 29, 2026
38e0b59
Skip alias snapshots for recorded synthesized names
NatElkins Oct 29, 2026
7dc5867
Deduplicate method updates without a reversed list
NatElkins Oct 29, 2026
96ea5de
Use immutable capability sets with stable diagnostic order
NatElkins Oct 30, 2026
ba7a61d
Reuse exact-value environment switch checks
NatElkins Oct 30, 2026
5fa4385
Format rude edit diagnostics without intermediate strings
NatElkins Oct 30, 2026
c74868c
Collect tracked inputs in one ordered pass
NatElkins Oct 30, 2026
e0aa055
Use value options for hot reload symbol lookups
NatElkins Oct 30, 2026
1f1463b
Reduce closure naming and resumption point allocations
NatElkins Oct 30, 2026
ba67dd8
Name internal checked project implementation fields
NatElkins Oct 30, 2026
baf0a24
Avoid temporary collections in hot reload preparation
NatElkins Oct 30, 2026
17441af
Preserve cancellation through hot reload error recovery
NatElkins Oct 30, 2026
df69c82
Observe cancellation while awaiting stable hot reload output
NatElkins Oct 30, 2026
6d39e9f
Skip metadata snapshots for ordinary in-memory emission
NatElkins Oct 30, 2026
e5aaec2
Assert actual PDB delta documents and heap contents
NatElkins Oct 30, 2026
3f381a3
Dispose each portable PDB content hash provider
NatElkins Oct 30, 2026
b285d73
Preserve cancellation in hot reload metadata fallbacks
NatElkins Oct 30, 2026
c121fdd
Keep the in-memory writer result private
NatElkins Oct 30, 2026
fb4793e
Apply scoped F# conventions to hot reload helpers
NatElkins Oct 30, 2026
b457bc3
Skip hot reload context lookup without registered projects
NatElkins Oct 30, 2026
0b9add5
Avoid optional allocation during closure name overrides
NatElkins Oct 30, 2026
fa79c59
Remove redundant rude-edit severity helper
NatElkins Oct 30, 2026
2e2fad2
Clarify closure identity and state-machine comments
NatElkins Oct 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/hot-reload-rude-edits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# F# hot reload rude-edit diagnostics

F# hot reload reports an `FSHRDL` diagnostic when an edit cannot be applied safely to the running process. The application is rebuilt and restarted instead of applying a delta that could leave it in an invalid state.

The diagnostic message identifies the affected declaration and the reason for the restart. These codes are owned by the F# compiler and are separate from Roslyn's `ENC` diagnostic namespace.

| Code | Meaning | What to do |
| --- | --- | --- |
| `FSHRDL001` | A member signature changed. | Undo the signature change to apply in place, or allow the rebuild and restart. |
| `FSHRDL002` | An `inline` annotation changed. | Allow the rebuild and restart. |
| `FSHRDL003` | A type representation or layout changed. | Allow the rebuild and restart. |
| `FSHRDL004` | A declaration was added in a shape the runtime cannot add. | Allow the rebuild and restart. |
| `FSHRDL005` | A declaration was removed. | Allow the rebuild and restart. |
| `FSHRDL006` | A virtual, abstract, or override member was added. | Allow the rebuild and restart. |
| `FSHRDL007` | A constructor was added. | Allow the rebuild and restart. |
| `FSHRDL008` | A user-defined operator was added. | Allow the rebuild and restart. |
| `FSHRDL009` | An explicit interface implementation was added. | Allow the rebuild and restart. |
| `FSHRDL010` | A member was added to an interface. | Allow the rebuild and restart. |
| `FSHRDL011` | A field was added in a shape the runtime cannot add. | Allow the rebuild and restart. |
| `FSHRDL012` | A lambda's lowered shape changed incompatibly. | Allow the rebuild and restart. |
| `FSHRDL013` | A state machine's resumable or hoisted layout changed incompatibly. | Keep the existing resume-point and captured-value layout, or allow the rebuild and restart. |
| `FSHRDL014` | A query expression's lowered shape changed incompatibly. | Allow the rebuild and restart. |
| `FSHRDL015` | A synthesized compiler declaration changed incompatibly. | Allow the rebuild and restart. |
| `FSHRDL016` | The runtime did not advertise a capability required by the edit. | Update the runtime if a newer version supports the capability, or allow the rebuild and restart. |
| `FSHRDL099` | The edit is unsupported for another fail-closed reason. | Follow the detailed message and allow the rebuild and restart. |

These diagnostics are intentionally fail closed. If the compiler cannot prove that an edit is safe, it requests a restart and leaves the running application unchanged.
4 changes: 4 additions & 0 deletions docs/release-notes/.FSharp.Compiler.Service/11.0.100.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@

### Added

* Add an internal typed-tree diff utility for future F# hot reload edit classification. It is not called by normal compilation. ([PR #20025](https://github.com/dotnet/fsharp/pull/20025))
* Added internal synthesized-name replay infrastructure for compiler-generated names, preserving normal compilation output while enabling future hot reload name stability work.
* Added internal F# hot reload delta emitter and symbol matcher infrastructure with direct emitter test coverage. ([PR #20027](https://github.com/dotnet/fsharp/pull/20027))
* Added `FSharpMemberOrFunctionOrValue.IsPropertyAccessor` convenience property that returns true for compiler-generated property accessors (`get_X` / `set_X`). ([Issue #18157](https://github.com/dotnet/fsharp/issues/18157), [PR #19883](https://github.com/dotnet/fsharp/pull/19883))
* Added warning FS3884 when a function or delegate value is used as an interpolated string argument. ([PR #19289](https://github.com/dotnet/fsharp/pull/19289))
* Symbols: add ObsoleteDiagnosticInfo ([PR #19359](https://github.com/dotnet/fsharp/pull/19359))
Expand All @@ -150,6 +152,8 @@
* Add internal `ResetCompilerGeneratedNameState` to `CompilerGlobalState` name generators so warm-checker re-compilation can produce fresh-process-identical generated names. ([PR #20017](https://github.com/dotnet/fsharp/pull/20017))
* Add internal ECMA-335 Edit-and-Continue metadata delta writer to AbstractIL. ([PR #20019](https://github.com/dotnet/fsharp/pull/20019))
* Add Roslyn-format EnC CustomDebugInformation codec and portable PDB method CDI emission support to AbstractIL. ([PR #20018](https://github.com/dotnet/fsharp/pull/20018))
* Add an experimental `FSharpChecker` hot reload session API with per-project baselines, capability-gated delta emission, and `Commit`/`Discard` transaction semantics. Off by default behind `--test:HotReloadDeltas`. ([Issue #11636](https://github.com/dotnet/fsharp/issues/11636), [PR #20030](https://github.com/dotnet/fsharp/pull/20030))
* Add internal hot reload baseline reading for recorded EnC state and synthesized-name snapshot PDB data. ([PR #20026](https://github.com/dotnet/fsharp/pull/20026))
* Support for the `<include>` XML documentation tag: at compile time, documentation is copied from an external XML file selected by an XPath query and emitted into the generated documentation file. `<inheritdoc>` remains unsupported. ([Issue #19175](https://github.com/dotnet/fsharp/issues/19175), [PR #19186](https://github.com/dotnet/fsharp/pull/19186))
* Expand `<inheritdoc/>` at tooling time. In IDE tooltips, completion, and signature help, documentation is inherited from base classes, interfaces, overridden members, and constructors (matched by parameter signature). The FCS Symbols API (`FSharpSymbol.XmlDoc`) additionally resolves explicit `cref` targets, but does not expand constructor inheritance. The compiler emits the tag verbatim into generated XML documentation files, matching C#; `<include>` is not implemented. ([Issue #19175](https://github.com/dotnet/fsharp/issues/19175), [PR #19188](https://github.com/dotnet/fsharp/pull/19188))

Expand Down
3 changes: 2 additions & 1 deletion src/Compiler/AbstractIL/DeltaIndexSizing.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ module internal FSharp.Compiler.AbstractIL.DeltaIndexSizing

open FSharp.Compiler.AbstractIL.BinaryConstants
open FSharp.Compiler.AbstractIL.ILDeltaHandles
open FSharp.Compiler.AbstractIL.ILMetadataHeaps
open FSharp.Compiler.AbstractIL.DeltaMetadataEncoding

type MetadataHeapSizes = FSharp.Compiler.AbstractIL.ILBinaryWriter.MetadataHeapSizes

/// Holds computed "bigness" flags for all coded index types.
/// When true, the index requires 4 bytes; when false, 2 bytes suffice.
type CodedIndexSizes =
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/AbstractIL/DeltaMetadataSerializer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ open System
open System.Collections.Generic
open System.IO
open System.Text
open FSharp.Compiler.AbstractIL.ILMetadataHeaps
open FSharp.Compiler.AbstractIL.ILBinaryWriter
open FSharp.Compiler.AbstractIL.BinaryConstants
open FSharp.Compiler.AbstractIL.ILDeltaHandles
open FSharp.Compiler.AbstractIL.DeltaMetadataTables
Expand Down
169 changes: 168 additions & 1 deletion src/Compiler/AbstractIL/EncMethodDebugInformation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ open System.IO
open System.Reflection.Metadata
open System.Reflection.Metadata.Ecma335
open System.Runtime.InteropServices
open System.Text
open Microsoft.FSharp.NativeInterop

open FSharp.Compiler.AbstractIL.ILPdbWriter

/// Portable-PDB CustomDebugInformation kind GUIDs for the EnC blobs, copied verbatim
/// from roslyn/src/Dependencies/CodeAnalysis.Debugging/PortableCustomDebugInfoKinds.cs.
[<RequireQualifiedAccess>]
Expand All @@ -47,6 +50,10 @@ module PortableCustomDebugInfoKinds =
/// EnC State Machine State Map CDI kind.
let encStateMachineStateMap = Guid("8B78CD68-2EDE-420B-980B-E15884B8AAA3")

/// F#-owned hot reload synthesized-name snapshot CDI kind. The blob records
/// FSharpSynthesizedTypeMaps.Snapshot bucket arrays in allocation-slot order.
let fsharpSynthesizedNameSnapshot = Guid("49DDB47E-9C74-46EC-8626-0350676571EB")

/// Closure ordinal of a lambda that is lowered to a static (non-capturing) method.
/// Mirrors Roslyn's LambdaDebugInfo.StaticClosureOrdinal.
[<Literal>]
Expand Down Expand Up @@ -167,7 +174,7 @@ let private MaxOccurrenceKey = 0x1FFFFFFD
/// 16-bit segments, least-significant segment = the innermost ordinal; an enclosing
/// ordinal p is stored as (p + 1) shifted left 16 so that depth-1 keys (< 0x10000) and
/// depth-2 keys (>= 0x10000) never collide. Fails closed (None) past the limits: chains
/// deeper than 2, ordinals > 0xFFFF, or keys exceeding the compressed-integer budget —
/// deeper than 2, ordinals > 0xFFFF, or keys exceeding the compressed-integer budget,
/// callers must then treat the chain as unmappable, never truncate.
let tryEncodeOccurrenceKey (ordinalChain: int list) : int option =
match ordinalChain with
Expand Down Expand Up @@ -209,6 +216,134 @@ let private invalidData (blobName: string) (offset: int) =
// nullness model, so guard with box (FS3261-safe) rather than dropping the check.
let private isEmpty (blob: byte[]) = isNull (box blob) || blob.Length = 0

// ---------------------------------------------------------------------------
// F# hot reload module CDI: synthesized-name allocation snapshot
// Format:
// compressed(version = 1), compressed(bucket count),
// then buckets sorted by key for deterministic PDB bytes:
// string key, compressed(name count), string name in allocation-slot order.
// Strings are compressed(byte length) followed by UTF-8 bytes.
// ---------------------------------------------------------------------------

[<Literal>]
let private SynthesizedNameSnapshotBlobVersion = 1

let private writeUtf8String (builder: BlobBuilder) (value: string) =
if isNull (box value) then
invalidArg (nameof value) "snapshot strings must be non-null"

let bytes = Encoding.UTF8.GetBytes value
builder.WriteCompressedInteger bytes.Length
builder.WriteBytes bytes

let private readUtf8String (blobName: string) (reader: byref<BlobReader>) =
let length = reader.ReadCompressedInteger()

if length < 0 || length > reader.RemainingBytes then
invalidData blobName reader.Offset

let bytes = reader.ReadBytes length
Encoding.UTF8.GetString(bytes, 0, bytes.Length)

let private materializeSynthesizedNameSnapshot (snapshot: seq<struct (string * string[])>) =
snapshot
|> Seq.map (fun struct (key, names) ->
if isNull (box key) then
invalidArg (nameof snapshot) "snapshot keys must be non-null"

if isNull (box names) then
invalidArg (nameof snapshot) $"snapshot bucket '{key}' must be non-null"

key, Array.copy names)
|> Seq.sortBy fst
|> Seq.toArray

/// Serializes an allocation-ordered synthesized-name snapshot into the F#-owned module
/// CDI blob. An empty snapshot returns an empty blob so no CDI row needs to be emitted.
let serializeSynthesizedNameSnapshot (snapshot: seq<struct (string * string[])>) : byte[] =
let buckets = materializeSynthesizedNameSnapshot snapshot

if buckets.Length = 0 then
Array.empty
else
let builder = BlobBuilder()
builder.WriteCompressedInteger SynthesizedNameSnapshotBlobVersion
builder.WriteCompressedInteger buckets.Length

for key, names in buckets do
writeUtf8String builder key
builder.WriteCompressedInteger names.Length

for name in names do
writeUtf8String builder name

builder.ToArray()

/// Deserializes the F#-owned synthesized-name snapshot CDI blob. Bucket order in the
/// blob is deterministic only; each bucket array is returned exactly in recorded slot order.
let deserializeSynthesizedNameSnapshot (blob: byte[]) : Map<string, string[]> =
if isEmpty blob then
Map.empty
else
let handle = GCHandle.Alloc(blob, GCHandleType.Pinned)

try
let mutable reader =
BlobReader(NativePtr.ofNativeInt<byte> (handle.AddrOfPinnedObject()), blob.Length)

try
let version = reader.ReadCompressedInteger()

if version <> SynthesizedNameSnapshotBlobVersion then
invalidData "synthesized name snapshot" reader.Offset

let bucketCount = reader.ReadCompressedInteger()

if bucketCount <= 0 || bucketCount > reader.RemainingBytes / 2 then
invalidData "synthesized name snapshot" reader.Offset

let buckets = ResizeArray<string * string[]>()

for _ in 1..bucketCount do
let key = readUtf8String "synthesized name snapshot" &reader
let nameCount = reader.ReadCompressedInteger()

// Every serialized name consumes at least one byte for its UTF-8
// length, so this check bounds allocation before Array.zeroCreate.
if nameCount < 0 || nameCount > reader.RemainingBytes then
invalidData "synthesized name snapshot" reader.Offset

let names = Array.zeroCreate nameCount

for i in 0 .. nameCount - 1 do
names[i] <- readUtf8String "synthesized name snapshot" &reader

buckets.Add(key, names)

if reader.RemainingBytes <> 0 then
invalidData "synthesized name snapshot" reader.Offset

buckets |> Seq.map id |> Map.ofSeq
with :? BadImageFormatException ->
invalidData "synthesized name snapshot" reader.Offset
finally
handle.Free()

/// Creates the module-level CustomDebugInformation row for the allocation-ordered
/// synthesized-name snapshot. Empty snapshots emit no row.
let computeSynthesizedNameSnapshotCustomDebugInfoRows (snapshot: seq<struct (string * string[])>) : PdbModuleCustomDebugInfo list =
let blob = serializeSynthesizedNameSnapshot snapshot

if blob.Length = 0 then
[]
else
[
{
KindGuid = PortableCustomDebugInfoKinds.fsharpSynthesizedNameSnapshot
Blob = blob
}
]

// ---------------------------------------------------------------------------
// EnC Local Slot Map
// Format (EditAndContinueMethodDebugInformation.cs, SerializeLocalSlots lines 145-191,
Expand Down Expand Up @@ -555,3 +690,35 @@ let readEncMethodDebugInfoFromPortablePdb (pdbBytes: byte[]) : Map<int, EncMetho
// Not a portable PDB image (or a corrupted one): callers still get an empty
// map instead of a crash.
Map.empty

/// Reads the F#-owned allocation-ordered synthesized-name snapshot from a portable PDB.
/// None means either the record is absent or invalid; callers must fall back to IL
/// reconstruction rather than trusting a partial layout.
let readSynthesizedNameSnapshotFromPortablePdb (pdbBytes: byte[]) : Map<string, string[]> option =
if isEmpty pdbBytes then
None
else
try
use provider =
MetadataReaderProvider.FromPortablePdbImage(ImmutableArray.CreateRange pdbBytes)

let reader = provider.GetMetadataReader()

let blobs =
[
for cdiHandle in reader.CustomDebugInformation do
let cdi = reader.GetCustomDebugInformation cdiHandle

if cdi.Parent.Kind = HandleKind.ModuleDefinition then
let kind = reader.GetGuid cdi.Kind

if kind = PortableCustomDebugInfoKinds.fsharpSynthesizedNameSnapshot then
reader.GetBlobBytes cdi.Value
]

match blobs with
| [ blob ] -> Some(deserializeSynthesizedNameSnapshot blob)
| _ -> None
with
| :? BadImageFormatException
| :? InvalidDataException -> None
21 changes: 21 additions & 0 deletions src/Compiler/AbstractIL/EncMethodDebugInformation.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ module PortableCustomDebugInfoKinds =
/// EnC State Machine State Map CDI kind.
val encStateMachineStateMap: System.Guid

/// F#-owned hot reload synthesized-name snapshot CDI kind.
val fsharpSynthesizedNameSnapshot: System.Guid

/// Closure ordinal of a lambda that is lowered to a static (non-capturing) method.
/// Mirrors Roslyn's LambdaDebugInfo.StaticClosureOrdinal.
[<Literal>]
Expand Down Expand Up @@ -135,6 +138,19 @@ val tryEncodeOccurrenceKey: ordinalChain: int list -> int option
/// root-first ordinal chain.
val decodeOccurrenceKey: key: int -> int list

/// Serializes an allocation-ordered synthesized-name snapshot into the F#-owned module
/// CDI blob. An empty snapshot returns an empty blob so no CDI row needs to be emitted.
val serializeSynthesizedNameSnapshot: snapshot: seq<struct (string * string[])> -> byte[]

/// Deserializes the F#-owned synthesized-name snapshot CDI blob. Bucket order in the
/// blob is deterministic only; each bucket array is returned exactly in recorded slot order.
val deserializeSynthesizedNameSnapshot: blob: byte[] -> Map<string, string[]>

/// Creates the module-level CustomDebugInformation row for the allocation-ordered
/// synthesized-name snapshot. Empty snapshots emit no row.
val computeSynthesizedNameSnapshotCustomDebugInfoRows:
snapshot: seq<struct (string * string[])> -> FSharp.Compiler.AbstractIL.ILPdbWriter.PdbModuleCustomDebugInfo list

/// Serializes the EnC Local Slot Map blob for 'info', byte-for-byte as Roslyn's
/// SerializeLocalSlots. Returns the empty array when there are no slots (no CDI row
/// should be emitted then).
Expand Down Expand Up @@ -176,3 +192,8 @@ val deserialize:
/// Fail safe: a null/empty or non-PDB image yields the empty map, and a method whose
/// blobs do not decode is omitted rather than guessed.
val readEncMethodDebugInfoFromPortablePdb: pdbBytes: byte[] -> Map<int, EncMethodDebugInformation>

/// Reads the F#-owned allocation-ordered synthesized-name snapshot from a portable PDB.
/// None means either the record is absent or invalid; callers must fall back to IL
/// reconstruction rather than trusting a partial layout.
val readSynthesizedNameSnapshotFromPortablePdb: pdbBytes: byte[] -> Map<string, string[]> option
2 changes: 1 addition & 1 deletion src/Compiler/AbstractIL/FSharpDeltaMetadataWriter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module internal FSharp.Compiler.AbstractIL.FSharpDeltaMetadataWriter
open System
open System.Collections.Generic
open Microsoft.FSharp.Collections
open FSharp.Compiler.AbstractIL.ILMetadataHeaps
open FSharp.Compiler.AbstractIL.ILBinaryWriter
open FSharp.Compiler.AbstractIL.BinaryConstants
open FSharp.Compiler.AbstractIL.ILDeltaHandles
open FSharp.Compiler.AbstractIL.IlxDeltaStreams
Expand Down
Loading
Loading