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

Tree-sitter integration #395

Open
liuchengxu opened this issue Apr 8, 2021 · 2 comments
Open

Tree-sitter integration #395

liuchengxu opened this issue Apr 8, 2021 · 2 comments

Comments

@liuchengxu
Copy link
Owner

tree-sitter/tree-sitter#1042

And an external binary is planned. Feel free to drop any ideas about the tree-sitter integration.

@rene-descartes2021
Copy link

rene-descartes2021 commented Aug 2, 2022

EDIT: Actually scratch using node-tree-sitter, it uses a native (C++) extension with node-gyp and Deno won't ever support that. Looks Deno supports FFI with Rust though with deno_bindgen. Need to think/prototype on this more. I don't want to depend on Node.js so node-tree-sitter is off the table.

I'm writing a prototype to use Deno/denops.vim to use node- tree-sitter in Vim/Neovim. So... Deno would be the external binary.

npm to download grammars, and Node.js or Deno to build/generate the parser from that.

I'm currently tinkering around with some proposed space-vim layers (nodejs, rustc, denops, tree-sitter layers) to get tree-sitter parsing and that usable by Vim plugins including vista.vim. All in a zero-install and built-from-source way for the end-user.

Using the tree-sitter rust bindings in an external rust binary could possibly be a better performing alternative to Deno/denops (Rust/WASM) interface with tree-sitter, but that is out of reach for me to prototype. I should look at vim-clap Rust/vimscript implementation.

@liuchengxu
Copy link
Owner Author

I'm writing a prototype to use Deno/denops.vim to use node- tree-sitter in Vim/Neovim. So... Deno would be the external binary.

Cool, keep up the great work. denops.vim looks interesting.

Unfortunately, I don't have much time for these side projects recently, the long-term goal(which may never be able to be realized) is to support writing plugins in Rust that works for both Vim and Neovim, but the communication between Vim and Rust in vim-clap is quite limited at present, and there is a lot of room to improve in various places, so vim-clap can do many things in a non-ideal way, don't expect it's well-designed :D

Some popular Rust-based editor projects are already using the tree sitter (https://github.com/lapce/lapce, https://github.com/helix-editor/helix), theoretically, a lot of goodness in these projects can be easily reused in Vim/NeoVim if using Rust, though they're made to be the next generation of editors.

@liuchengxu liuchengxu unpinned this issue May 1, 2023
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

2 participants