Skip to content

Add autocompletion to language server #176

@aboeglin

Description

@aboeglin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions