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

doesn't work with rustic #105

Closed
p00f opened this issue Nov 23, 2023 · 2 comments
Closed

doesn't work with rustic #105

p00f opened this issue Nov 23, 2023 · 2 comments

Comments

@p00f
Copy link
Contributor

p00f commented Nov 23, 2023

I'm using (according to this comment)

However, this doesn't work for evil-textobj-tree-sitter. This change works, not sure if this is ideal:

diff --git a/evil-textobj-tree-sitter-core.el b/evil-textobj-tree-sitter-core.el
index 818e99a..0ab321a 100644
--- a/evil-textobj-tree-sitter-core.el
+++ b/evil-textobj-tree-sitter-core.el
@@ -61,7 +61,8 @@
 (defun evil-textobj-tree-sitter--use-builtin-treesitter ()
   "Return non-nil if we should use builtin treesitter."
   (and evil-textobj-tree-sitter--can-use-builtin-treesit
-       (string-suffix-p "-ts-mode" (symbol-name major-mode))))
+       (or (string= "rustic-mode" (symbol-name major-mode))
+           (string-suffix-p "-ts-mode" (symbol-name major-mode)))))
 
 (defun evil-textobj-tree-sitter--get-queries-dir ()
   "Get the queries directory.
@meain
Copy link
Owner

meain commented Nov 23, 2023

This should work for your current usecase, but I don't want to include this upstream until either of these(rust-lang/rust-mode#482 or brotzeit/rustic#527) is merged into master. Both use different way to switch to between elisp-tree-sitter and builtin treesit. The first one uses rust-mode-treesitter-derive to switch and the second one introduces a new mode rustic-ts-mode.

@p00f
Copy link
Contributor Author

p00f commented Nov 23, 2023

Understood, thanks!

@p00f p00f closed this as completed Nov 23, 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