-
Notifications
You must be signed in to change notification settings - Fork 180
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
provide alternative rust-mode that derives from rust-ts-mode #482
Conversation
I was just looking into a way to complement the new |
If rust-mode was a new package that's supposed to add features to rust-ts-mode it would make sense to use a minor mode. I think there is no real downside to using a derived mode and this way we don't have to apply any additional changes. We can still change this once treesitter is the standard and the old code is deprecated. For now it seems to be the more convenient solution. But maybe I'm wrong. Other opinions ? @jimblandy @psibi |
Ha, I see your point, and backward compatibility is indeed a nice thing :) Maybe it would be nice if the control variable defaulted to t whenever (defcustom rust-mode-treesitter-derive
(and (fboundp 'treesit-language-available-p)
(treesit-language-available-p 'rust))
… |
I thought about it but the ts mode applies different syntax highlighting. Users will probably complain that we just change the default. Many rust-mode users only want very basic features. I know those people probably won't use emacs master, but I would wait. |
I think we should always feel free to make substantial improvements even when they change behavior. If treesitter is available, reliable, and really provides the improvements it claims to, we should just use it. |
Is anything blocking this feature being merged? AFAICS it should be a noop until explicitly enabled. |
Can this be merged? |
hello. will this be merged or are there any more to be done first? thank you! |
I have done a minor change to this PR to make it work for my setup (Emacs 29.1). I can confirm that it works with my basic testing. I'm planning to test drive this PR for around a week to see if I face any issues and merge it if I see no issues. If others can test drive this PR meanwhile, that will be helpful. An easy way to test this is setting the following variable:
And in your rust code buffer, check that tree sitter based functions is working (Eg: |
No description provided.