Skip to content

🤔 How to create completion items when OCaml-style local opens are involved? #139

Open
@kentookura

Description

@kentookura

@jonsterling @favonia

The way I am currently creating completion items in the forester LSP is that I just map over the environment that results from expanding the entire forest, but in light of OCaml-style local opens, this is not the correct thing to do. I need to consider what is visible at the cursor position in order to create the correct items.

I would like to create a function of the following signature:

val visible_at: position: Lsp.Types.Position.t -> Syn.t -> exports

where Syn.t is defined here and exports is defined here

One thing I am considering is to write a variant of expand that works roughly like:

if node.loc < position
  expand next node
else
  return currently visible

Does this seem viable? Keen to hear your thoughts!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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