WIP basic completions support in core #774
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
completions
RPC from coreCore
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.
completions_show
RPCcompletions_cancel
RPC, (probably);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.completion_insert
RPC, for when the client actually choses a completion; this will apply the completion's edit.Client
completions
RPC in response to some debug hotkeycompletions
responseselect_completion
RPC as selection changescompletions
calls.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?