Skip to content

Ignore --pathmap in the IDE's F# project options - #20470

Open
xperiandri wants to merge 4 commits into
dotnet:mainfrom
xperiandri:fix/ignore-pathmap-in-ide
Open

xperiandri wants to merge 4 commits into
dotnet:mainfrom
xperiandri:fix/ignore-pathmap-in-ide

Conversation

@xperiandri

@xperiandri xperiandri commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

In a solution whose Directory.Build.props sets <PathMap>$(MSBuildThisFileDirectory)=.\</PathMap> or DeterministicSourcePaths, Go To Definition from an F# file into another F# project of the solution opens the generated signature instead of the source. The declaration comes back named .\backend\Use cases\Circulars\GraphQL\.\backend\Use cases\Circulars\GraphQL\Types\Circular.fs: the project system passes the build's --pathmap: into the IDE's compilation options, FCS applies it when it pickles the ranges of the in-memory referenced-assembly data, and the implicit include directory it is joined with is mapped too. No lookup by path can find such a file.

The map also leaks between projects. TcGlobals carries it, and FCS caches TcGlobals with the framework imports under a key that does not include it, so one project with a --pathmap: is enough to break navigation into any sibling of the same framework set, and a project with a map is checked without it when a sibling filled the cache first. #20476 fixes the cache; dropping the option in the IDE makes the cached map empty for all of them.

FSharpProjectOptionsManager now drops --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.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Release notes checked


✅ Found changes and release notes in following paths:

Change path Release notes path Description
`vsintegration/src` docs/release-notes/.VisualStudio/18.vNext.md

@T-Gro T-Gro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖🕵️ LGTM & approved, but CI is red.

@github-project-automation github-project-automation Bot moved this from New to In Progress in F# Compiler and Tooling Sep 7, 2026
xperiandri added a commit to xperiandri/fsharp that referenced this pull request Sep 11, 2026
xperiandri added a commit to xperiandri/fsharp that referenced this pull request Sep 11, 2026
@xperiandri
xperiandri force-pushed the fix/ignore-pathmap-in-ide branch from aee3361 to 39cd09d Compare September 11, 2026 16:18
@github-actions github-actions Bot added the ⚠️ Affects-Design-Time Tooling check: PR touches type providers or dependency manager label Sep 11, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@T-Gro T-Gro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖🕵️ Please make the description more concise using this guidance. Keep the problem and why the change is needed prominent, using short sentences in simplified technical English. Retain necessary caveats.

@T-Gro T-Gro added the vsintegration-only Changes only Visual Studio integration, plus optional docs, release notes, or tests label Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Tooling Safety Check — Affects-Design-Time
Affects-Design-Time: Compiler service or Visual Studio behavior changed.

Generated by PR Tooling Safety Check · gpt56 1.9M · ◷

xperiandri and others added 4 commits September 26, 2026 02:59
…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>
Copilot AI lite review requested due to automatic review settings September 26, 2026 00:59
@xperiandri
xperiandri force-pushed the fix/ignore-pathmap-in-ide branch from 39cd09d to 00e8c04 Compare September 26, 2026 00:59
xperiandri added a commit to xperiandri/fsharp that referenced this pull request Sep 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The only finding is a non-blocking nit concerning unused test scaffolding.

Review effort: Lite
Findings: None

What changed in this PR

This PR removes build-only --pathmap options from IDE F# project settings to preserve cross-project source navigation.

Changes:

  • Filters --pathmap: from IDE compilation options.
  • Adds multi-project navigation regression tests and helpers.
  • Updates Visual Studio release notes.
File Summary
vsintegration/​tests/​FSharp.Editor.Tests/​PathMapNavigationTests.fs Adds path-map navigation regression tests.
vsintegration/​tests/​FSharp.Editor.Tests/​Helpers/​RoslynHelpers.fs Adds multi-project test helpers.
vsintegration/​tests/​FSharp.Editor.Tests/​FSharp.Editor.Tests.fsproj Includes the new tests.
vsintegration/​src/​FSharp.Editor/​LanguageService/​FSharpProjectOptionsManager.fs Removes --pathmap: from IDE options.
docs/​release-notes/​.VisualStudio/​18.vNext.md Documents the fix.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

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

Labels

⚠️ Affects-Design-Time Tooling check: PR touches type providers or dependency manager AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files vsintegration-only Changes only Visual Studio integration, plus optional docs, release notes, or tests

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants