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

Rank tab-completions and suggestions using type information #337

Open
sharkdp opened this issue Feb 11, 2024 · 0 comments
Open

Rank tab-completions and suggestions using type information #337

sharkdp opened this issue Feb 11, 2024 · 0 comments
Labels

Comments

@sharkdp
Copy link
Owner

sharkdp commented Feb 11, 2024

This might be hard to implement, but …

It would be great if we could rank/filter tab-completions and suggestions using type information. For example, if someone types 3 cm -> [Tab], we could ideally only show suggestions that would type-check (e.g. matching units).

To implement this, we would essentially have to run the compiler up to the type-checker phase on a substring of the user input (the left-hand-side of the conversion operator in the example above). Because running it on the full input would lead to a parse error.

Another example:

>>> Atan(2,3)
error: while type checking
  ┌─ <input:4>:1:1
  │
1 │ Atan(2,3)
  │ ^^^^ unknown callable
  │
  = Did you mean 'atan'?>>> Atan(2,3)

could be improved by returning atan2 as a suggestion, even if it's further away in terms of edit-distance.

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

No branches or pull requests

1 participant