Ignore --pathmap in the IDE's F# project options - #20470
Open
xperiandri wants to merge 4 commits into
Open
Conversation
…r tests Test helpers so far put every synthetic file into one Roslyn project. CreateMultiProjectSolution creates one project per synthetic project with project references, the way VS wires project-to-project references; CreateMultiTargetSolution creates one project per target instance sharing the project path and the document paths, the way VS loads a multi-targeted project. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A project built with DeterministicSourcePaths or an explicit PathMap hands the IDE a `--pathmap:` option. FCS applies the map when it pickles the ranges of the in-memory reference other projects check against, so every symbol imported from such a project names a mapped, relative file that no workspace document has, and Go To Definition ends in the generated signature instead of the source. The map is a property of the build output; the IDE now drops it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev
|
T-Gro
approved these changes
Sep 7, 2026
T-Gro
left a comment
Member
There was a problem hiding this comment.
🤖🕵️ LGTM & approved, but CI is red.
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.
Description
In a solution whose
Directory.Build.propssets<PathMap>$(MSBuildThisFileDirectory)=.\</PathMap>(orDeterministicSourcePaths), Go To Definition from an F# file to a symbol declared in another F# project of the solution opens the generated signature (the "F# Metadata" document) instead of the source. Reproduced with the in-box tools too.Measured in the debugger: for a symbol imported from a sibling project,
FindDeclResult.DeclFoundcarried.\backend\Use cases\Circulars\GraphQL\.\backend\Use cases\Circulars\GraphQL\Types\Circular.fswhile the workspace document isD:\Boardwise\core\backend\Use cases\Circulars\GraphQL\Types\Circular.fs. The project system passes the build's--pathmap:into the IDE's compilation options; FCS appliestcGlobals.pathMapwhen it pickles the ranges of the in-memory referenced-assembly data (TypedTreePickle.fs), andComputeMakePathAbsolutethen prepends the equally mapped implicit include directory. No lookup by path can find such a file.The map also leaks between projects.
TcGlobalscarriespathMap, and FCS cachesTcGlobalstogether with the framework imports (FrameworkImportsCache,IncrementalBuild.fs), keyed by the framework assemblies, the primary assembly, the target framework directories, the compiler binaries and the import-reuse key — not by the path map. A project that reuses the cached entry only refresheslangVersion,realsigandcompilationModeon it, so every project of one framework set pickles its ranges with the map of whichever project built the imports first: one project with a--pathmap:is enough to break navigation into any sibling, and a project with a map whose sibling came first is checked without it. Dropping the option in the IDE makes the cachedpathMapempty for all of them; the FCS cache itself is unchanged here.Fix:
FSharpProjectOptionsManagerdrops--pathmap:from the options it takes from the project site, next to the-r:options it already discards. The map only describes what the build should write into its output; nothing in the IDE needs it.Tests:
PathMapNavigationTestsbuilds a library and an application referencing it, both with--pathmap:<root>=.as aDirectory.Build.propswould set it (with the map on the library alone the outcome depends on which project fills the framework cache first), and checks that the computed options have no--pathmap:and that Go To Definition from the application lands on the library's source file. Both fail without the fix.Checklist
Test cases added
Performance benchmarks added in case of performance changes
Release notes entry updated:
🤖 Generated with Claude Code