VS: initialize package in the background
Description
Fixes #18623
Checklist
-
[ ] Test cases added
-
[ ] Performance benchmarks added in case of performance changes
-
[ ] Release notes entry updated:
Please make sure to add an entry with short succinct description of the change as well as link to this pull request to the respective release notes file, if applicable.
Release notes files:
- If anything under
src/Compilerhas been changed, please make sure to make an entry indocs/release-notes/.FSharp.Compiler.Service/<version>.md, where<version>is usually "highest" one, e.g.42.8.200 - If language feature was added (i.e.
LanguageFeatures.fsiwas changed), please add it todocs/release-notes/.Language/preview.md - If a change to
FSharp.Corewas made, please make sure to editdocs/release-notes/.FSharp.Core/<version>.mdwhere version is "highest" one, e.g.8.0.200.
Information about the release notes entries format can be found in the documentation. Example:
- More inlines for Result module. (PR #16106)
- Correctly handle assembly imports with public key token of 0 length. (Issue #16359, PR #16363)
*
while!(Language suggestion #1038, PR #14238)
If you believe that release notes are not necessary for this PR, please add
NO_RELEASE_NOTESlabel to the pull request. - If anything under
:heavy_exclamation_mark: Release notes required
:white_check_mark: Found changes and release notes in following paths:
Change path Release notes path Description vsintegration/srcdocs/release-notes/.VisualStudio/18.0.md
Works ok in experimental instance. It seems we don't need the UI thread during package init. This must wait because currently the vsix cannot be installed
Thanks for taking this up @majocha . This has the potential to speed up solution opening, so I am really glad the new API model allows us to make this split.
Lets merge this in after it can be locally tested.
I included fix for https://github.com/dotnet/fsharp/issues/18904. The setting was never set because the Initialize method was never called. We could extract the fix to another PR if needed.
I included fix for #18904. The setting was never set because the
Initializemethod was never called. We could extract the fix to another PR if needed.
Excellent for finding that out, @majocha . No need to extract it, we can keep it as a single PR bere.
I'm testing this PR atm. It seems fine now. FSI initializes ok. If there are any problems, (for example deadlocks at startup) it's a matter of moving some things from the background to foreground init.
I am going to merge this as it fixes an important user-facing regression with the solution crawler. (especially on large solutions this would degrade the experience a lot)
@majocha : You are our hero 👍 !
/backport to release/dev18.0
Started backporting to release/dev18.0: https://github.com/dotnet/fsharp/actions/runs/18745823459
@T-Gro backporting to "release/dev18.0" failed, the patch most likely resulted in conflicts:
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: vs initialize in background
Using index info to reconstruct a base tree...
M vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs
Falling back to patching base and 3-way merge...
Auto-merging vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs
CONFLICT (content): Merge conflict in vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 vs initialize in background
Error: The process '/usr/bin/git' failed with exit code 128
Please backport manually!