Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/stuck code lenses #852

Merged
merged 2 commits into from
Nov 11, 2021
Merged

Conversation

beauvankirk
Copy link
Contributor

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?

bvankirk-ercot and others added 2 commits November 10, 2021 23:52
…ts so lenses wait for check to complete. Appears to fix broken code lenses in Ionide following 5.9.0 release.
@baronfel
Copy link
Contributor

This seems like a good change. I think I with with the try path in an attempt to make this request faster, with the understanding that user edits would trigger subsequent calls to this endpoint. However, due to the timing issues between having type check data after an edit, and the time it takes to call this endpoint, this endpoint would very, very rarely have the latest data.

@baronfel baronfel merged commit a9d8519 into ionide:main Nov 11, 2021
@beauvankirk
Copy link
Contributor Author

beauvankirk commented Nov 11, 2021

Thank you! What are the typical next steps to get this fix in the published vscode extension...does there need to be a new release of FSAC for it to reference before it can do its own release?

Or should I ask that over there?

@baronfel
Copy link
Contributor

technically no but practically yes.

FSAC is pulled into Ionide via a paket github reference, and so can pick specific refs - including commits. however, we generally don't do this and constrain ourselves to using tags as the refs. this is good because the tag+release pipeline in this repo also pushes the dotnet tool version of FSAC, which is how most of our vim/emacs users get the tool.

baronfel pushed a commit to baronfel/FsAutoComplete that referenced this pull request Nov 14, 2021
…ts so lenses wait for check to complete. Appears to fix broken code lenses in Ionide following 5.9.0 release. (ionide#852)

Co-authored-by: Beau Van Kirk <Beau.VanKirk@ercot.com>
@baronfel
Copy link
Contributor

I'm making the release now, and as I go I'm updating the README in this repo and in ionide about how the release is actually done so that folks have a better idea in the future. Thanks again for your contribution, @beauvankirk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants