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

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

Open
kentookura opened this issue Nov 19, 2024 · 0 comments

Comments

@kentookura
Copy link

@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!

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