Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per @Krzysztof-Cieslak, opening PR here in relation to original on ionide-vscode-fsharp.
Copied from original:
This change attempts to address the broken code lenses with the recent ionide-vscode-fsharp's 5.9.0 release as raised in 1620.
The issue appears to be rooted in a change in the FSAutoComplete update, wherein the LspServer.CodeLensResolve method was altered to call an Option<>-returning function (TryGetRecentTypeCheckResultsForFile in 0.49.0) rather than an Async<Option<>>-returning function (TryGetLatestTypeCheckResultsForFile in 0.48.1) to check for FCS Checker results. The line with the new call is here
I'm not sure this is the best fix, but I revised the CodeLensResolve to instead call GetLatestTypeCheckResultsForFile, which returns an Async<_>. This seems to (correctly in my opinion) wait for FCS check results before resolving the code lens. The method I opted for is also the one that retained the same comment as the previous version's variant, so it seems perhaps that was the intended more-direct replacement?