fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

VS: initialize package in the background

Open majocha opened this issue 7 months ago • 3 comments

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/Compiler has been changed, please make sure to make an entry in docs/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.fsi was changed), please add it to docs/release-notes/.Language/preview.md
    • If a change to FSharp.Core was made, please make sure to edit docs/release-notes/.FSharp.Core/<version>.md where version is "highest" one, e.g. 8.0.200.

    Information about the release notes entries format can be found in the documentation. Example:

    If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request.

majocha avatar Jun 02 '25 09:06 majocha

:heavy_exclamation_mark: Release notes required


:white_check_mark: Found changes and release notes in following paths:

Change path Release notes path Description
vsintegration/src docs/release-notes/.VisualStudio/18.0.md

github-actions[bot] avatar Jun 02 '25 09:06 github-actions[bot]

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

majocha avatar Jun 02 '25 12:06 majocha

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.

T-Gro avatar Jun 03 '25 06:06 T-Gro

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.

majocha avatar Sep 16 '25 17:09 majocha

I included fix for #18904. The setting was never set because the Initialize method 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.

T-Gro avatar Sep 17 '25 07:09 T-Gro

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.

majocha avatar Sep 17 '25 08:09 majocha

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 👍 !

T-Gro avatar Sep 17 '25 09:09 T-Gro

/backport to release/dev18.0

T-Gro avatar Oct 23 '25 10:10 T-Gro

Started backporting to release/dev18.0: https://github.com/dotnet/fsharp/actions/runs/18745823459

github-actions[bot] avatar Oct 23 '25 10:10 github-actions[bot]

@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!

github-actions[bot] avatar Oct 23 '25 10:10 github-actions[bot]