tommilata / intelliroutes

Support for Play Routes in IntelliJ IDEA
MIT License
19 stars 6 forks source link

Support for multiple routes files (the "routes" split into many) #13

Open labedzkim opened 4 years ago

labedzkim commented 4 years ago

Hi Tomas! Your plugin makes my daily work easier :) Thank you! I've got a suggestion to implement support for the case when you have the single "routes" file split into multiple ones. I'm making this suggestion to you instead of contributing directly as I'm afraid the learning curve would kill me. Cheers!

For example, I've got the following files: admin.routes agreements.routes orders.routes routes

And the routes file looks like this: -> /admin admin.Routes -> /agreements agreements.Routes -> /orders orders.Routes # Home GET / features.home.rest.HomeController.index

tommilata commented 4 years ago

Hi Maciej, thanks a lot for your feedback! I'll see what I can do.

tommilata commented 4 years ago

What features exactly do you think would be most useful?

I can think of

  1. clicking admin.Routes in the line -> /admin admin.Routes of the routes file would navigate to the admin.routes file
  2. typing -> /admin in the routes file would autocomplete to -> /admin admin.Routes

Any other ideas?

tommilata commented 4 years ago

In terms of just syntax highlighting and rendering, is there anything that's wrong or broken in your use case?

I didn't notice anything obvious.

Screenshot 2020-10-23 at 10 56 06
tommilata commented 4 years ago

I've released an alpha version with a minimal implementation of autocomplete for other *routes files. Testing it out is very appreciated. You can get it from https://plugins.jetbrains.com/plugin/10053-play-2-routes/versions/alpha/100403.

Screenshot 2020-10-23 at 16 05 47
tommilata commented 4 years ago

... and now also the "Go To" action (on click). Available at https://plugins.jetbrains.com/plugin/10053-play-2-routes/versions/alpha/100418.

Screenshot 2020-10-23 at 22 08 16
tommilata commented 4 years ago

I've released this now. It should be available as version 2020.2.4 in a few business days via the marketplace or via this link https://plugins.jetbrains.com/plugin/10053-play-2-routes/versions/stable/100521 now.

I hope it helps. And don't forget to rate it on https://plugins.jetbrains.com/plugin/10053-play-2-routes/ ;)

labedzkim commented 4 years ago

Hi Tomas! Thank you for your quick reaction. In my case it was about refactoring the names of controller methods. They were not updated in the routes files. Let me check the plugin after your updates. I'll provide you my feedback ASAP. Cheers!

labedzkim commented 4 years ago

Hi Tomas! Works good! :) What could be considered for future would be to make possible the following:

tommilata commented 4 years ago

Hi, thanks for trying it out. I appreciate your feedback! I'll try to do something about it.