RicardoRamirezR / blade-nav.nvim

Navigating Blade views within Laravel projects
MIT License
51 stars 7 forks source link

Does not account for `index` files #2

Closed calebdw closed 4 months ago

calebdw commented 4 months ago

Hello!

Awesome plugin!!

I just wanted to let you know that this does not open anonymous-index-components:

for example, I have the following file:

views/components/form/index.blade.php

Clicking gf on the <x-form ...> tag prompts me to create the file instead of opening the index file.

Thanks!

RicardoRamirezR commented 4 months ago

Thanks @calebdw

I can't reproduce the issue.

In my case, the did not exist, so I created it anonymously, then used gf and it worked. 😏

form-index

RicardoRamirezR commented 4 months ago

@calebdw please position the cursor in any place of form.input and then gf

calebdw commented 4 months ago

I have this code:

                <x-form>
                    <div>foo</div>
                </x-form>

And the associated blade for the x-form is located at resources/views/components/form/index.blade.php.

Placing my cursor on x-form causes the prompt to be shown:

image

It looks like it's incorrectly parsing the name as form>

RicardoRamirezR commented 4 months ago

Ohh there are two issues:

  1. incorrectly parsing the name as form>
  2. the index.blade.php of form, I was not aware of this
RicardoRamirezR commented 4 months ago

@calebdw done!

calebdw commented 4 months ago

That was fast!

RicardoRamirezR commented 4 months ago

@calebdw

I have this code:

                <x-form>
                    <div>foo</div>
                </x-form>

If the anonymous-index-components does not exist, should there be an option to create it?

calebdw commented 4 months ago

I suppose that could be on the list of recommendations, you might have to create the directory though