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

Documentation for Use in JetBrains RustRover #115

Open
naftulikay opened this issue Apr 12, 2024 · 4 comments
Open

Documentation for Use in JetBrains RustRover #115

naftulikay opened this issue Apr 12, 2024 · 4 comments

Comments

@naftulikay
Copy link

I've been using JetBrains RustRover for quite a while now, and as I'm learning Leptos, I'd love to integrate it better with this IDE. Does anyone know how to do this/whether it's possible? And if it is, can I contribute documentation to explain how to set it up?

@bram209
Copy link
Owner

bram209 commented May 24, 2024

I don't use RustRover myself, but you could try: https://www.jetbrains.com/help/idea/using-file-watchers.html

File Watcher is an IntelliJ IDEA tool that allows you to automatically run a command-line tool like compilers, formatters, or linters when you change or save a file in the IDE.

@spencewenski
Copy link

spencewenski commented Aug 9, 2024

The File Watchers plugin works fairly well. I've noticed that it conflicts the the normal cargo fmt that jetbrains normally runs, however. I haven't figured out a fix for this yet. It also will run when I'm in the middle of editing the view! macro contents, which can be annoying.

@bram209
Copy link
Owner

bram209 commented Aug 9, 2024

I've noticed that it conflicts the the normal cargo fmt that jetbrains normally runs

I suppose you could disable rustfmt completely, and then use your file watcher to sequentially run rustfmt and leptosfmt? That the file watcher runs in the middle of editing sounds annoying, though.

@bram209
Copy link
Owner

bram209 commented Aug 9, 2024

Another option that might help (quoted from https://www.jetbrains.com/help/idea/using-file-watchers.html#ws_filewatcher_advanced_options):

Specify the events that will invoke the File Watcher:

  • To invoke the File Watcher as soon as any changes are made to the source code, select the Auto-save edited files to trigger the watcher checkbox.
  • When the checkbox is cleared, the File Watcher starts upon save (File | Save All) or when you move the focus from IntelliJ IDEA (on frame deactivation).

This might be the best of both worlds: format on frame deactivation might give you a bit more control of when the formatter runs, whilst you still don't have to manually trigger it.

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

3 participants