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

Rework the core logic of provider in Rust #872

Merged
merged 173 commits into from
Jan 8, 2023
Merged

Conversation

liuchengxu
Copy link
Owner

@liuchengxu liuchengxu commented Sep 11, 2022

The goal of this PR is to overhaul the bridge between Vim and Rust, making it possible to delegate all the heavy jobs onto the Rust backend and make Vim a mere UI layer as much as possible. It's mainly achieved by allowing the Rust backend to retrieve and manipulate the Vim state on demand, which also unlocks a lot of features I'm looking forward to, such as tree-sitter highlights(#532), the preview scroll(#573), and the input history(#235).

Notable changes:

  • Switch to the new stdio_server implementation.
    • Allow calling Vim methods actively, this is the key to support a lot of new features later.
    • A lot of old workarounds for improving the performance are able to be safely removed, and a bunch of vimscripts have been deleted.
    • Now the Rust binary is mandatory to make each provider work even if the source of it is purely from the inside Vim, in which case the source items will be passed to the Rust backend.
  • More flexible debounce delay for on_typed hook.
  • Add on_move debounce delay on the Rust side.
  • Specify the icon attribute in each provider explicitly if it's supported, Null by default.
  • Allow setting the debounce per provider, the debounce is enabled by default.
  • The required Rust version is updated to the latest stable.

After switching to the native searcher instead of processing the output of the shell command rg, the grep and files, blines provider is significantly faster and more responsive.

There are still some TODOs and optimizations that can be done, but it should work in most cases, any feedback is welcome and testers are appreciated.

Close #875

autoload/clap/state.vim Outdated Show resolved Hide resolved
@liuchengxu liuchengxu merged commit 0647599 into master Jan 8, 2023
@liuchengxu liuchengxu deleted the remove-deprecated-runner branch January 8, 2023 06:07
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

Successfully merging this pull request may close these issues.

Use the library ripgrep instead of relying on the executable rg
2 participants