Skip to content

Answer the Navigate To search that runs while the solution loads - #20492

Draft
xperiandri wants to merge 5 commits into
dotnet:mainfrom
xperiandri:feature/navigate-to-while-loading
Draft

xperiandri wants to merge 5 commits into
dotnet:mainfrom
xperiandri:feature/navigate-to-while-loading

Conversation

@xperiandri

@xperiandri xperiandri commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

While a solution is loading, Navigate To (Ctrl+T) returned nothing from F# projects, and Roslyn does not repeat the search after loading, so F# declarations stayed missing until the user searched again. F# now implements the loading-time search (dotnet/roslyn#85213) with parse-only results. They may be approximate until project options arrive and are re-parsed accurately afterwards. The search is throttled so it does not slow the load.

Draft: cannot build until the Roslyn dependency includes dotnet/roslyn#85213. Stacked on #20409.

🤖 Generated with Claude Code

@github-actions

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

🤖🕵️ 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
@xperiandri

Copy link
Copy Markdown
Contributor Author

Moved out of the PR description per the pr-description guidance — how this was verified, since the branch cannot build in CI yet.

Against a local build of Roslyn containing dotnet/roslyn#85213: NavigateToSearchWhileLoadingTests, three tests — the loading search finds a declaration where the accurate search raises for want of options; a file behind #if FOO read under the wrong defines returns nothing and does not poison the accurate search that follows once --define:FOO arrives; and every project is reported complete exactly once whether or not anything was found in it. With the approximate check removed, the first two fail. With NavigateToSearchServiceTests and CopilotContextProviderTests, 31 pass. The full FSharp.Editor.Tests run: 7219 passed, 2 skipped, 4 failed — fsiShouldTriggerCompletionInFsxFile and three type provider tests, which fail the same way on this branch's base without its commits. FSharp.Editor builds with -p:Optimize=true.

Checked live as well, with that Roslyn build deployed to the experimental hive: on a 26-project mixed C#/F# solution, breaking in the F# implementation gives the stack ProcessOrderedProjectsAsync → NavigateToSearcher.SearchCachedDocumentsAsync → the external access adapter → here, with the active document and priority documents intact, and Ctrl+T lists F# declarations immediately while the solution is still loading.

@xperiandri
xperiandri force-pushed the feature/navigate-to-while-loading branch 2 times, most recently from 603ceb0 to b3b3cdc Compare September 26, 2026 01:01
@xperiandri
xperiandri force-pushed the feature/navigate-to-while-loading branch 2 times, most recently from 64778a6 to c14c3f4 Compare October 8, 2026 01:11
@xperiandri
xperiandri force-pushed the feature/navigate-to-while-loading branch from c14c3f4 to f4ddfd7 Compare October 10, 2026 22:28
@xperiandri
xperiandri force-pushed the feature/navigate-to-while-loading branch from f670007 to b17a05b Compare October 29, 2026 22:03
xperiandri and others added 5 commits November 5, 2026 21:03
With no options from the project system yet, the quick parsing options
carried no source files, and ParseFile throws looking for the last
compiland. Nothing parsed with them before a project had loaded; the
Navigate To search that runs during load does.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Navigate To runs a search of its own during load, dispatched through
`IAdvancedNavigateToSearchService`. F# did not implement it, so every F#
project was reported complete and searched not at all, and no full search
follows by design — nothing F# declares could be found until the user searched
again.

The search is a parse away. What it lacked is the project's compilation
options, which do not exist yet during load, so `GetFSharpParseResultsAsync`
raises. `GetFSharpQuickParseResultsAsync` parses with whatever parsing options
the project system has already produced, or defaults: a dictionary read, no
reactor, no I/O, which is what makes it safe to call for every document of
every project while the solution loads.

Those defines can be the wrong ones, and the document's version does not change
when the real options arrive, so the version stamp alone would let an
approximate parse answer the accurate search: a declaration behind `#if` could
be missed, or reported from a branch that never compiles. The cache entry
carries whether it was approximate, and the accurate path refuses those,
reparsing instead. The loading path takes either, since its contract allows
out-of-date results.

`SearchCachedDocumentsAsync` follows the shape of the C# and VB service:
priority documents and the projects that hold them are searched first, results
are reported per document rather than per project so the first ones appear
while the rest are still parsing, and each project is reported complete once it
is done. The parses of every project take turns on one throttle that leaves a
core free, so a search during load cannot take the cores away from the load
itself.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`main` opened 11.0.200 for SDK 11.0.200; 11.0.100 has shipped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Replaying the branch onto main left some files short of the branch's own content; this restores it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…with the collection assert

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@xperiandri
xperiandri force-pushed the feature/navigate-to-while-loading branch from c525021 to a28b628 Compare November 5, 2026 20:05

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

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants