codingyu / laravel-goto-view

vscode extension
MIT License
46 stars 28 forks source link

Add support for multiple folder #3

Closed MehediDracula closed 5 years ago

MehediDracula commented 6 years ago

First of all, this extension is awesome

I would like to suggest you something. one of in my project i have multiple views root folder. This extension is not working there as it's only searching inside laravel's default 'resources/views' folder.

it would be great if i can add an array of locations in settings.

codingyu commented 6 years ago

Support for multiple folder has been added.

MehediDracula commented 6 years ago

Thanks for this

another thing i would like to suggest. since on laravel we can add namespaced views like below. it will be also a good idea to add support for namespaced views

View::addNamespace('theme', '/path/to/themes/views');

return view('theme::view.name');
codingyu commented 6 years ago

Ah but this may depend on where the namespace definition, I will try to achieve this function, thanks

ctf0 commented 6 years ago

@codingyu it is possible for now to add this functionality ? so it works with the vendor views too

so calling Abc::x would open views/vendor/Abc/x.blade.php

MehediDracula commented 6 years ago

@codingyu since vscode has per workspace based settings maybe this extension can leverage that. maybe we can define settings in workspace settings file like below

{
    "theme": "/path/to/themes/views"
}
codingyu commented 6 years ago

@ctf0 @MehediDracula
Do you like this way? 203821 203902 204132

MehediDracula commented 6 years ago

that looks amazing :fire: :fire:

ctf0 commented 6 years ago

@codingyu many thanx for the awesome job, but one question, does the settings image means that the user have to pre populate all the possible paths beforehand for the package to work correctly ?

if so then it defines the purpose, cuz this should be done internally ex.

this way you dont need to make any changes for each project you work on, and the path resolving stays dynamic all the time

MehediDracula commented 6 years ago

@ctf0 I don't think it would be ideal as your views can be anywhere. if this extension only searches on resources/views folder then it can't be configured.

currently, I'm working on a modular project where each module's view is under Modules/{ModuleName}/Resources/views folder. so, I think using settings is flexible here.

ctf0 commented 6 years ago

@MehediDracula your example is not the default for the most, however to keep it flexible the resources/views could be the default for the settings, unless you added an extra path like yours

codingyu commented 6 years ago

@ctf0 Thank you for your advice. The next version will try this function. ☺️