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

initial stab at completion context for string literals #830

Merged
merged 4 commits into from
Sep 9, 2021

Conversation

baronfel
Copy link
Contributor

@baronfel baronfel commented Sep 8, 2021

This is an initial attempt at satisfying ionide/ionide-vscode-fsharp#1575.

The idea is to use the parsetree to determine if we're inside a literal (either actual string literal or a string portion of an interpolated string) and if so short-circuit and return no completion entries (or no hover text as appropriate). This seems to allow the other extension to take over easily enough.

@baronfel
Copy link
Contributor Author

baronfel commented Sep 8, 2021

@alfonsogarciacaro do you know of any extensions that provide hover tooltips for html elements?

@alfonsogarciacaro
Copy link
Contributor

This is great @baronfel, thanks a lot for taking a look at it so quickly! I've published a new version of the F# template highlight extension (1.2) that forward tooltip requests for template strings. Right now, it only works if Ionide is disabled so it would be a very good test case. The extension ignores holes in interpolated strings, so for those Ionide should take over :)

screencast

@baronfel
Copy link
Contributor Author

baronfel commented Sep 9, 2021

Thanks @alfonsogarciacaro, I'll take a look :)

@baronfel
Copy link
Contributor Author

baronfel commented Sep 9, 2021

Yep, works great with this change:

image

@baronfel
Copy link
Contributor Author

baronfel commented Sep 9, 2021

Chatted over this a bit in the #fsautocomplete slack channel and we're good with this approach. Will polish it up and get new versions made to unblock y'all.

@baronfel baronfel merged commit 74d1621 into ionide:master Sep 9, 2021
@baronfel baronfel deleted the string-literal-context branch September 9, 2021 17:55
@baronfel
Copy link
Contributor Author

baronfel commented Sep 9, 2021

This has been released in FSAC 0.47.2

@baronfel
Copy link
Contributor Author

baronfel commented Sep 9, 2021

Released in ionide 5.7.2.

@alfonsogarciacaro
Copy link
Contributor

Thanks a lot for the release @baronfel! I tried it but when updating to Ionide 5.7.2 the extension doesn't activate at all. I must admit that I hacked a bit the code of the previous release, but even after a clean re-install of VS Code (also deleting ~/.vscode and ~/AppData/Roaming/Code) the problem is still there. When I revert to 5.7.1 then it works. Is this only happening to me? 🤔

@Krzysztof-Cieslak
Copy link
Member

5.7.2 seems to be working fine for me

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

Successfully merging this pull request may close these issues.

3 participants