Skip to content

Consider emitting CompilationOptions into Portable PDB #12002

Open

Description

@dsyme

Our Portable PDB writer doesn't emit PortableCustomDebugInfoKinds.CompilationOptions

This information is emitted by C#, allowing a compilation to be resurrected from a PDB.

Portable PDB spec is here: https://github.com/dotnet/runtime/blob/main/docs/design/specs/PortablePdb-Metadata.md

It may be useful for F# to emit this information in some situation once we clarify what debugging experience it supports. https://github.com/dotnet/roslyn/blob/3d8acbd585a75e9cdb3509623bf6c39ceb46b2c2/src/Compilers/Core/Portable/PEWriter/MetadataWriter.PortablePdb.cs#L853

  • clarify user-facing debug experience this supports
  • decide if it's useful for F#
  • add code to emit this if it's useful

Activity

  1. added
    Area-Debugstepping, debug points, stacks and more
    on Aug 20, 2021
  2. baronfel commented on Aug 20, 2021

    @baronfel
    Member

    Doing this will also light up a checkmark in Nuget Package Explorer and dotnet validate experiences.

    It might also enable better sourcelink-based go-to-definition experiences, because these options could be reconstituted into an accurate Project Options structure that could be used to provide actual typecheck results for that file (this is currently a problem in the kinds of views used by FSAC for sourcelink-based go-to-definition).

  3. changed the title [-]Consider emitting compilation options into Portable PDB[/-] [+]Consider emitting CompilationOptions into Portable PDB[/+] on Aug 23, 2021
  4. added this to the Backlog milestone on Oct 19, 2022
  5. baronfel commented on Mar 25, 2023

    @baronfel
    Member

    Now that all of the major editors support fetching actual source via sourcelink, I think this should be prioritized. Emitting compiler options (which include metadata references!) into PDBs will allow for seamless navigation and editor experiences in the automatically-downloaded sources - right now once you enter into an F# source file downloaded in this way you're in a broken state in terms of editor functionality. The downloaded files don't support further navigation, proper highlighting, or intellisense - all because compilation options and references aren't available to reconstruct ProjectOptions for the file transparently on the editor side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions