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

Simple completion in type hints/definitions #908

Merged
merged 3 commits into from
Apr 3, 2022

Conversation

tboby
Copy link
Contributor

@tboby tboby commented Apr 3, 2022

This adds a simple, flawed, but nevertheless useful, filter to completion results when the location is inside a SynType. This works in record fields and type hints. I haven't checked exhaustively, but I trust the AST walker and unless I've misunderstood we shouldn't find general expressions inside.

I tried to use this for Type parameters but it didn't work. I'm not very familiar with FCS's internals but I suspect it only uses getAllSymbols as a fallback and so doesn't need it in type pars. I imagine this means this feature will stop working with some future update of FCS.

This feature still suffers from the problem of the first few characters not triggering completion correctly.

Completion in a record field's type:
image

Completion in a normal expression:
image

Completion in a type hint:
image

Q: Are there any other completion items that should be returned? Keywords?

Copy link
Contributor

@baronfel baronfel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good usability fix, and something we can build on 👍

@baronfel baronfel merged commit 3e0e0de into ionide:main Apr 3, 2022
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.

2 participants