Open chriso0710 opened 5 years ago
Hi Christan, thanks for your suggestion.
Views In the case of showing all views, I've take then view (ha) that this is something you would only want a full listing of from the controller. If you run alt+r or alt+v from the controller file you will see them there.
Fast switching to a view from a model? alt+c alt+v in quick succession and you have the list, and this combined with VSCode not keeping file tabs around unless they've changed is pretty good. Of course I could add alt+v from the model, I'm tempted to do that, but I don't want all the views listed in the alt+r list from the model.
Decorator/presenter
This is an interesting idea. It would require a bit of modification. I probably wouldn't want to make it specific to those as they're not standard Rails files, but perhaps making it do a search on app/*/model_name_*.rb
would be sensible.
Thanks for your quick response and your opinion on this.
I would like to have the views available from the model with ALT-R or ALT-V. Maybe we could have an individual setting for this...
Yes, decorators are not standard Rails (they should be IMHO). I can not imagine any professional/larger Rails project not using the decorator/presenter pattern. Makes developer life so much better :-) I think it would be a good fit for your extension.
Christian
Hi Jeremy,
I just tested some of the rails smart file switchers in the VS Code marketplace. I think yours is the best and the fastest. I particularly like the 2 lines per file in the switcher with the type headline.
These are the files for a contract model in my rails app:
Your extension only shows the test and the controller file in my project. It would be great if it would also show all views and the decorator/presenter. Maybe the additional tests, helper and JS files too.
I would have tried to fix this myself and sent a PR, but I have no TS skill and currently no local dev environment for TS ;-)
Christian