Skip to content

Classify each Find All References line while the search runs - #20533

Draft
xperiandri wants to merge 3 commits into
dotnet:mainfrom
xperiandri:feature/find-references-classified-lines
Draft

xperiandri wants to merge 3 commits into
dotnet:mainfrom
xperiandri:feature/find-references-classified-lines

Conversation

@xperiandri

@xperiandri xperiandri commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Find All References re-classified every F# result line after the search, one reference at a time, through the F# classification service; for closed files that could recompute a whole-file classification repeatedly. C# and VB hand over the classified line while searching. With dotnet/roslyn#85281, F# now does the same, classifying the line while the checked file is still at hand. C# and VB references are unaffected.

Draft: cannot build until dotnet/roslyn#85281 has flowed.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Sep 13, 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

Comment on lines 48 to 50
@@ -48,11 +49,21 @@ module FSharpFindUsagesService =
|> Option.map (fun (definitionItem, _) -> definitionItem)
|> Option.defaultValue externalDefinitionItem

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
|> Option.defaultValue externalDefinitionItem
|> Array.tryFindV (snd >> (=) doc.Project.FilePath)
|> ValueOption.map (fun (definitionItem, _) -> definitionItem)
|> ValueOption.defaultValue externalDefinitionItem

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Split out as #20534 — this line isn't touched by this PR.

@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 shorten the description using this guidance. Focus on the problem and why the change is needed, in simplified technical English. Leave the implementation inventory to the Files tab and retain necessary caveats.

@github-project-automation github-project-automation Bot moved this from New to In Progress in F# Compiler and Tooling Sep 15, 2026
@T-Gro T-Gro added the vsintegration-only Changes only Visual Studio integration, plus optional docs, release notes, or tests label Sep 21, 2026
@xperiandri
xperiandri force-pushed the feature/find-references-classified-lines branch 2 times, most recently from 9ee88cb to db208c0 Compare September 26, 2026 01:01
@xperiandri
xperiandri force-pushed the feature/find-references-classified-lines branch 2 times, most recently from fda5983 to 0478aa2 Compare October 8, 2026 01:11
@xperiandri
xperiandri force-pushed the feature/find-references-classified-lines branch from 0478aa2 to d3a5862 Compare October 10, 2026 22:28
@xperiandri
xperiandri force-pushed the feature/find-references-classified-lines branch from d3a5862 to 72f95e1 Compare October 29, 2026 22:03
@github-actions

Copy link
Copy Markdown
Contributor

Build Failure Analysis

Summary - All 15 failing Windows build legs stop in FSharp.Editor.fsproj because the checked-in Roslyn toolset exposes only the two-argument FSharpSourceReferenceItem constructor, while this PR calls the new four-argument overload.

Root cause: required Roslyn API has not flowed

The binlogs consistently report FS0501 from FindUsagesService.fs. The PR source constructs FSharpSourceReferenceItem with classifiedSpans and highlightSpan, but the referenced assembly requires FSharpSourceReferenceItem(definition, sourceSpan). This matches the PR's existing draft dependency on dotnet/roslyn#85281. The 15 companion binlogs all succeeded and contained no independent failed-target or process evidence.

Affected errors

Fix attempt - blocked

Delivery - none

No source change was published. Reverting this call to the available two-argument constructor would discard the classified-line data and defeat the feature. The safe fix is to flow a Roslyn build containing dotnet/roslyn#85281, then rebuild; the binlogs do not establish an exact compatible package version, so changing dependency pins here would be speculative. The PR is also on a contributor fork.

Checks - binlog_errors --limit 100 and binlog_overview completed for every one of the 30 recovered binlogs. Result: 15 build logs failed with the same FS0501; 15 companion logs succeeded with 0 errors. git rev-parse HEAD exited 0 and returned 72f95e1faa5549a10190912089dc1fbc0947af30. A local before/after VS integration build was not run because this Linux worker cannot validate the Windows-only target and no fix was applied. Remaining diagnostics: FS0501 in all 15 primary build logs.

Build evidence
Evidence Result
Failed project vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj
Failed target/task CoreCompile / Fsc
Toolset MSBuild 18.11.0-1.26427.13+9353559c2
Primary logs 15 failed; each reported the same constructor mismatch plus Build failed.
Companion logs 15 succeeded; 0 errors
Revalidated head 72f95e1faa5549a10190912089dc1fbc0947af30
Revalidated merge ref b4b9975d38f7f1a5b1de149d4ffbc65a7cb79fbf

Workflow run

Structured data:

{
  "artifact_kind": "analysis",
  "fix_delivery": "none",
  "fix_status": "blocked",
  "workflow_artifact": "build-failure-analysis"
}

Automated content by GitHub Copilot. Generated by the Build Failure Analysis workflow. · copilot · gpt56 · 200.2 AIC · ⌖ 10.7 AIC · ⊞ 21.3K | [History]( · ◷)

xperiandri and others added 3 commits November 5, 2026 21:20
C# and VB classify the line of each reference as they find it and hand it to
Find All References. F# handed nothing, so the window asked the F# classification
service for every line again after the search, one reference at a time.

ClassifiedReferenceLine classifies the line the way Roslyn does for them: from
the first non-whitespace character to the end of the line, semantic spans over
syntactic ones, gaps filled with text.

Needs the FSharpSourceReferenceItem constructor that takes the classified line,
from dotnet/roslyn#85281.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@xperiandri
xperiandri force-pushed the feature/find-references-classified-lines branch from 72f95e1 to a3dc004 Compare November 5, 2026 20:23

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

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.

2 participants