tree-sitter-module
rust-analyzer
tree-sitter-module | rust-analyzer | |
---|---|---|
10 | 133 | |
158 | 13,611 | |
- | 0.8% | |
7.2 | 10.0 | |
about 1 month ago | about 8 hours ago | |
Shell | Rust | |
- | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
tree-sitter-module
-
Let's write an Emacs treesitter major mode
BTW:
While Emacs 29.1 comes with "treesitter" built-in, you still need to manually build and install any treesitter language plugin implementing the actual language specific parser. This can be fiddly and frustrating doing it yourself.
I had a quick success with using this convenience script: https://github.com/casouri/tree-sitter-module/. It provides fully-automated builds for the most popular languages (including typescript, c and c++).
This is how it works for "typescript":
1. Clone the repository: https://github.com/casouri/tree-sitter-module/
2. Install "build-essentials" (providing a c/c++ compiler if you're on Linux).
3. run "./build typescript" from within the repo
4. Copy the resulting shared library from "dist/libtree-sitter-typescript.so" into your "~/.emacs.d/tree-sitter/".
5. Open a random typescript file and try "M-x typescript-ts-mode" which should not give you any error but instead nice syntax highlighting.
You might find there is a treesitter plugin for your language available and it is even supported by "tree-sitter-module" but there is still no major mode, yet. Happened to me for Perl 5.
-
Mastering Emacs: What's new in Emacs 29.1
I will look into building my own tree sitter grammars using https://github.com/casouri/tree-sitter-module as you suggest.
Some time ago I followed this guide https://vxlabs.com/2022/06/12/typescript-development-with-em...
-
Getting Emacs 29 to Automatically Use Tree-sitter Modes · robbmann
;; FIRST: git clone https://github.com/casouri/tree-sitter-module ;; bash batch.sh ;; THEN : sudo cp dist/* /usr/local/lib ;; FINALLY: (setq treesit-extra-load-path '("/usr/local/lib")) ;; Treesit ;; Eglot (setq treesit-eglot-modes '((:ts (bash-mode . bash-ts-mode) :pacman "bash-language-server") (:ts (c++-mode . c++-ts-mode) :pacman "ccls") (:ts (c-mode . c-ts-mode) :pacman "ccls") (:ts (cpp-mode . cpp-ts-mode) :pacman "ccls") (:ts (c-sharp-mode . sharp-ts-mode)) (:ts (cmake-mode . cmake-ts-mode)) (:ts (css-mode . css-ts-mode) :pacman "vscode-css-languageserver") (:ts (dockerfile-mode . dockerfile-ts-mode)) (:ts (elixir-mode . elixir-ts-mode)) (:ts (glsl-mode . glsl-ts-mode)) (:ts (go-mode . go-ts-mode) :pacman "gopls") (:ts (heex-mode . heex-ts-mode)) (:ts (html-mode . html-ts-mode) :pacman "vscode-html-languageserver") (:ts (java-mode . java-ts-mode)) (:ts (javascript-mode . js-ts-mode) :pacman "typescript-language-server") (:ts (js-json-mode . json-ts-mode) :pacman "vscode-json-languageserver") (:ts (julia-mode . julia-ts-mode)) (:ts (make-mode . make-ts-mode)) (:ts (markdown-mode . markdown-ts-mode)) (:ts (python-mode . python-ts-mode) :pacman "jedi-language-server") (:ts (typescript-mode . typescript-ts-mode) :pacman "typescript-language-server") (:ts (proto-mode . proto-ts-mode)) (:ts (ruby-mode . ruby-ts-mode)) (:ts (rust-mode . rust-ts-mode) :pacman "rust-analyzer") (:ts (sql-mode . sql-ts-mode)) (:ts (toml-mode . toml-ts-mode)) (:ts (tsx-mode . tsx-ts-mode)) (:ts (verilog-mode . verilog-ts-mode)) (:ts (vhdl-mode . vhdl-ts-mode)) (:ts (wgsl-mode . wgsl-ts-mode)) (:ts (yaml-mode . yaml-ts-mode) :pacman "yaml-language-server"))) ;; Not mature yet: ;; (push '(org-mode . org-ts-mode) major-mode-remap-alist) ;; (push '(perl-mode . perl-ts-mode) major-mode-remap-alist) ;; cpan Perl::LanguageServer (require 'treesit) ;; Function to parse the above and make an install command (if (treesit-available-p) (let ((pacman-install-list (list ))) (dolist (ts-pm treesit-eglot-modes) (let ((majmode-remap (plist-get ts-pm :ts)) (pacman-cmd (plist-get ts-pm :pacman))) ;; bind default major-mode to ts-mode (push majmode-remap major-mode-remap-alist) ;; populate install cmd (if pacman-cmd (unless (member pacman-cmd pacman-install-list) (push pacman-cmd pacman-install-list))))) (let ((install-cmd (concat "pacman -S --needed " (--reduce (concat acc " " it) pacman-install-list)))) (message install-cmd))) (user-error "Treesitter not available"))
- tree-sitter-module: Building script for tree-sitter language definitions
-
Emacs 29: Install Tree-Sitter parser modules with a minor mode
Also this https://github.com/casouri/tree-sitter-module/issues/13
-
Do I still need to install tree-sitter manually, for native tree-sitter in emacs29 to work?
I've downloaded and generated the libraries for the various languages from: https://github.com/casouri/tree-sitter-module
-
Setup Eglot in Emacs29 to recognize Python virtualenv
Third, I'm using tsitter in emacs29. I have https://github.com/casouri/tree-sitter-module installed as a sub-module in ~/.config/emacs, and have a symlink called tree-sitter to ./tree-sitter-module/dist (built by ./tree-sitter-module/batch.sh) . I'm mentioning the tsitter config here since I'm using python-ts-mode which is tree-sitter aware.
-
Is anyone working on a ruby tree sitter mode?
I'd recommend checking out https://github.com/casouri/tree-sitter-module for building the native treesit libraries that are required to enable the various languages.
-
How to use Emacs 29 Tree-sitter?
The author of the built-in tree-sitter implementation has published this repo with a build script to help you build various grammars: https://github.com/casouri/tree-sitter-module
rust-analyzer
-
Cranelift code generation comes to Rust
go build 3.62s user 0.76s system 171% cpu 2.545 total
I was looking forward to parallel front-end[4], but I have not seen any improvement for these small changes.
[1]: https://github.com/rust-lang/rust-analyzer
-
A guide on Neovim's LSP client
For example, intelephense can show diagnostics in real time, there is no need to save the file to get new diagnostics. But rust-analyzer, the language server for rust, can only update diagnostics after saving the file.
-
Top 10 Rusty Repositories for you to start your Open Source Journey
6. Rust Analyzer
-
The rust-analyzer vscode extension is not working at all.
The rust-analyzer readme suggests you go here for support request. But even there, you'll need to provide more details to get useful help.
-
LSP could have been better
For example: https://github.com/rust-lang/rust-analyzer/blob/master/docs/...
> If you create an LSP, it will work best in VS Code.
Any editor can work just as well as (or even better than) VS Code.
-
Discussion Thread
So, apparently the reason why rust-analyzer, the LSP server for Rust does not have persistent caching is because it would make "optimizing initial passes less important".
- The AI Content Flippening
-
Introducing RustRover – A Standalone Rust IDE by JetBrains
All I want to know is: Will it have a build configuration pulldown?
-
Mastering Emacs: What's new in Emacs 29.1
I am not a Rust dev. It surely looks great.
However, from what I understand it seems to supply just a parser separate from the Rust compiler (https://github.com/rust-lang/rust-analyzer/tree/master/crate...) trying to keep up with Rust‘s development. So, in principle, it could have been just another treesitter parser plugin, too.
So, again, the LSP framework does not directly provide any magical benefit over a static parsing framework. All the semantic analysis capabilities stem from a good parser.
-
helix shows rust "language server exited"
rust-analyzer > manual > helix > binary > rustup component add rust-analyzer
What are some alternatives?
treesit-auto - Automatic installation, usage, and fallback for tree-sitter major modes in Emacs 29
vscode-rust - Rust extension for Visual Studio Code
tree-sitter-langs - Language bundle for Emacs's tree-sitter package
intellij-rust - Rust plugin for the IntelliJ Platform
tree-sitter-c-sharp - C# Grammar for tree-sitter
rustfmt - Format Rust code
tree-sitter-typescript - TypeScript grammar for tree-sitter
sublime-rust - The official Sublime Text 4 package for the Rust Programming Language
nvim-treesitter-textobjects
coc-rust-analyzer - rust-analyzer extension for coc.nvim
git-sim - Visually simulate Git operations in your own repos with a single terminal command.
eglot - A client for Language Server Protocol servers