Skip to content
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

Consider emitting CompilationOptions into Portable PDB #12002

Open
3 tasks
Tracked by #12812
dsyme opened this issue Aug 20, 2021 · 2 comments · May be fixed by #14981
Open
3 tasks
Tracked by #12812

Consider emitting CompilationOptions into Portable PDB #12002

dsyme opened this issue Aug 20, 2021 · 2 comments · May be fixed by #14981
Labels
Area-Debug stepping, debug points, stacks and more Feature Improvement
Milestone

Comments

@dsyme
Copy link
Contributor

dsyme commented Aug 20, 2021

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
@dsyme dsyme added the Area-Debug stepping, debug points, stacks and more label Aug 20, 2021
@baronfel
Copy link
Member

baronfel commented Aug 20, 2021

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).

@dsyme dsyme changed the title Consider emitting compilation options into Portable PDB Consider emitting CompilationOptions into Portable PDB Aug 23, 2021
@vzarytovskii vzarytovskii moved this to Not Planned in F# Compiler and Tooling Jun 17, 2022
@vzarytovskii vzarytovskii added this to the Backlog milestone Oct 19, 2022
@baronfel
Copy link
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
Labels
Area-Debug stepping, debug points, stacks and more Feature Improvement
Projects
Status: New
Development

Successfully merging a pull request may close this issue.

3 participants