freshbitsweb / laravel-traveller

VS Code extension to travel through your Laravel app by just clicking on links.
5 stars 0 forks source link

Add support for blade layout extends and section directives #9

Open godismyjudge95 opened 3 years ago

godismyjudge95 commented 3 years ago

Hey if you could add support for the extends and section blade directives that would be much appreciated. See docs here: https://laravel.com/docs/8.x/blade#extending-a-layout

Thanks for such a great extension!

godismyjudge95 commented 3 years ago

My apologies, I noticed the extends directive works if there is no space between. For example, this does not work:

@extends ('backend.layouts.app')

But this does:

@extends('backend.layouts.app')

However, the section directives do not work at all:

@section('after-styles')
gauravmak commented 3 years ago

Little busy these days but I will surely work on this.

gauravmak commented 3 years ago

@godismyjudge95 Please update to v1.11.1 and the links should work even if there is a space after @extends or @include

The @section think looks challenging. How do you want the links to work? We are not referring to any specific file there, right?

godismyjudge95 commented 3 years ago

@gauravmak sorry it took me so long to get back with you, it appears that the latest version v1.11.3 is not working at all with any of the blade directives. It works fine for the view helper in the controller though.

The @section directive linking would work similarly to @extends in that it would link to whatever file is being extended but scroll to the @yield directive in the layout file. Sorry, I am not explaining this well.

An example would be if a file has @extends('backend.layouts.app') and then has @section('after-styles') somewhere in the same file, clicking on the @section would send you to the same file as the @extend (backend.layouts.app) but it would also scroll you to the @yield('after-styles') directive in that file.

Hope this makes sense. Thanks for working on these - I realize we are all pretty busy ;) Sidenote: I would love to help out with these features, but this plugin doesn't appear to be open source.

gauravmak commented 3 years ago

Thanks for the details buddy.

it appears that the latest version v1.11.3 is not working at all with any of the blade directives.

After changing the computer, packaging the new version wasn't just working. I was facing The specified icon 'extension/images/logo.png' wasn't found in the extension. and because of that I had to manually upload the package file via the website (instead of using the vsce tool) And I am still facing the same issue even today. Even the extension page is not showing the readme details but I just can't anything here.

An example would be if a file has @extends('backend.layouts.app') and then has @section('after-styles') somewhere in the same file, clicking on the @section would send you to the same file as the @extend (backend.layouts.app) but it would also scroll you to the @yield('after-styles') directive in that file.

Makes sense but is hard to implement. We have to read files and get data. Not something which is done in this package yet.

Sidenote: I would love to help out with these features, but this plugin doesn't appear to be open source.

Yeah, if this isn't fixed, I will work towards making it open so that you can contribute.

Thanks.