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

Provide option to use native emacs treesitter mode instead of rust-mode for emacs29+ #475

Open
brotzeit opened this issue Dec 20, 2022 · 15 comments

Comments

@brotzeit
Copy link
Owner

https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-29&id=cb8ccdd26702606710258e2e08bd1fc35bbc1674

@psibi
Copy link
Collaborator

psibi commented Dec 22, 2022

How are you planning to integrate this option ?

Some questions:

  • Will a new rustic-mode will be derive on top of the provided tree sitter based mode ? I personally think this is the future, but not sure about others. :-)
  • Will this new mode will be on-par with the current existing regex based one ? If not, where do they differ ?

@brotzeit
Copy link
Owner Author

brotzeit commented Dec 22, 2022

Will a new rustic-mode will be derive on top of the provided tree sitter based mode ? I personally think this is the future, but not sure about others. :-)

Given how fast treesitter modes are merged into emacs, it certainly looks like it. It also will be a lot easier to maintain progmodes. I'm looking forward to it because rust-mode can be really annoying. Maybe the reason why I've been the only rust-mode maintainer for quite some time though there are lots of emacs users using rust.

I think we don't need a new rustic-mode. It should be possible to let the user choose if rustic should derive from rust-mode or the new rust-ts-mode. Shouldn't be too difficult, unless I'm missing something.

Will this new mode will be on-par with the current existing regex based one ? If not, where do they differ ?

I have no idea what treesitter is capable of and how it compares to what rust-mode currently offers. But even if we have to use some kind of hybrid implementation, it will be a huge benefit. Indentation and font-locking alone can be a huge pain.

@brotzeit
Copy link
Owner Author

brotzeit commented Dec 22, 2022

I'm also curious how much overlap there is between treesitter and lsp. Seems lsp gradually intents to handle everything like systemd =)

@psibi
Copy link
Collaborator

psibi commented Dec 22, 2022

Maybe the reason why I've been the only rust-mode maintainer for quite some time though there are lots of emacs users using rust.

If it helps, I can additionally volunteer to maintain some parts of rust-mode. I did initially use rust-mode, but once I discovered rustic - I never reached back to it. But now that these both aren't even a fork, I wonder if it makes sense to merge both of them.

It should be possible to let the user choose if rustic should derive from rust-mode or the new rust-ts-mode.

Sounds like a good idea and I would be to switch to the ts based one.

I have no idea what treesitter is capable of and how it compares to what rust-mode currently offers.

I don't have a deep idea too, but from what I have seen so far - it looks to solve lots of hard problems in a much better way.

@brotzeit
Copy link
Owner Author

If it helps, I can additionally volunteer to maintain some parts of rust-mode.

Sure it's always good to have more maintainers. I even added a note to the readme some years ago.

But now that these both aren't even a fork, I wonder if it makes sense to merge both of them.

We had long discussions on how to do this and decided that we leave rust-mode for the users that prefer a mode only with basic features.

@brotzeit
Copy link
Owner Author

@psibi rust-mode

@mrcnski

This comment was marked as outdated.

@brotzeit
Copy link
Owner Author

It's already reverted. Seems I was too quick with the merge Button, sorry.

@mrcnski
Copy link
Contributor

mrcnski commented Dec 29, 2022

Thank you! I just had to wait a bit for it to update on Melpa. Works now!

@npajkovsky
Copy link

Any progress here?

yuuyins pushed a commit to yuuyins/rustic that referenced this issue Feb 12, 2023
@brotzeit
Copy link
Owner Author

Sorry, I still have to fix it. However if you are on emacs29 and treesitter is present it should be working with #480

@npajkovsky
Copy link

I'll give it a try. What do you need to fix?

@npajkovsky
Copy link

Indeed it needs more work

 Symbol’s value as variable is void: rustic-indent-offset

yuuyins pushed a commit to yuuyins/rustic that referenced this issue Apr 23, 2023
deftsp pushed a commit to deftsp/rustic that referenced this issue Aug 6, 2023
@appetrosyan
Copy link

Any update on this?

@psibi
Copy link
Collaborator

psibi commented Jul 14, 2024

You can use it now as part of emacs-rustic: https://github.com/emacs-rustic/rustic?tab=readme-ov-file#tree-sitter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants