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

WIP basic completions support in core #774

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Aug 3, 2018

This is intended as a starting point for ongoing completions work. I think it would be nice if we could try and wrap up a basic proof of concept for completions next week, as a nice marker for the summer's GSoC work. This will entail some coordination between @betterclever, @nangtrongvuon and myself, and I thought this PR might make a good platform for that work. @betterclever, we can try something new here and use this branch as a feature branch, and you can submit PRs against it.

Basic Autocomplete Todos:

This will require work on three fronts.

Language Plugins

The LSP plugin will need to:

  • handle the completions RPC from core
  • handle the response, converting it into a core-appropriate format
  • return the result or error to the core.

Core

Much of the completions work will be in core. Core must collect results from the (possibly multiple) plugin(s), and also filter and sort the results in response to client input, while keeping the client updated. Almost all of the state for a given completions request lives in core. Most of the following RPCs are in place, but may not have real implementations yet.

  • implement client->core completions_show RPC
  • implement client->core completions_cancel RPC, (probably);
  • implement client->core completion_select RPC, for when the client navigates up and down the completions list; this will be used to fetch additional completion information from the plugin if necessary.
  • implement client->core completion_insert RPC, for when the client actually choses a completion; this will apply the completion's edit.
  • implement the logic for applying the edit
  • implement a basic filtering/sorting mechanism, and calling it appropriately when the client enters text while completions are active

Client

  • send completions RPC in response to some debug hotkey
  • display list of completions when receiving completions response
  • allow navigation between items in the list, sending select_completion RPC as selection changes
  • update existing completions when receiving new completions calls.
  • send insert_completion when the user selects a completion.

This can all be very barebones. In particular, I don't want to spend much time on the sorting/filtering functions in core, and I don't want to worry about displaying documentation or extra details in the client; let's just try and get the plumbing in place, and we can go from there?

This adds very bare-bones completions support, and is intended as a
checkpoint.

This includes some updates to the sample plugin to make it send
completion suggestions if the word under the cursor looks like a file
path.
@cmyr cmyr removed the cla: yes label Sep 20, 2018
@cmyr cmyr mentioned this pull request Oct 17, 2018
12 tasks
@cmyr cmyr added the on hold label Oct 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants