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

Add autocompletion to language server #176

Open
aboeglin opened this issue Jun 8, 2024 · 0 comments
Open

Add autocompletion to language server #176

aboeglin opened this issue Jun 8, 2024 · 0 comments

Comments

@aboeglin
Copy link
Contributor

aboeglin commented Jun 8, 2024

Main idea is to have 2 states, one for diagnostics and one for auto completion. Whenever the diagnostic is successful ( no parse or type error ), we write the Rock state used for diagnostics to the autocompletion state.

Whenever we want to autocomplete something we don't invalidate any module but simply look at where the cursor is, identify if we're looking for a normal name, a record access, or a namespace import access and find all matching names in scope. Say if we typed record.a, we'll list all fields in record that start with a.

To do this we should probably also distinguish parse errors and type errors and make our type errors not bubble up to a whole top level function but rather be localized so that typechecking goes on and keeps as much type information as possible.

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

No branches or pull requests

1 participant