laravel-idea / plugin

Laravel Idea plugin for PhpStorm
https://laravel-idea.com/
165 stars 7 forks source link

[Bug]: Uknown view error for all views #945

Open smarkyun opened 6 months ago

smarkyun commented 6 months ago

Bug description

The plugin cannot find any views. I tried invalidating the cache and reinstalling the plugin, but nothing changed.

image image

Plugin version

8.1.2.233

Operating system

Linux

Steps to reproduce

No response

Relevant log output

No response

adelf commented 6 months ago

Hello. Could you check the Settings, Default view path and Default namespace parameters.

image
smarkyun commented 6 months ago

image

smarkyun commented 6 months ago

Please, it is very annoying

adelf commented 6 months ago

Could you find all loadViewsFrom and addLocation calls(use Scope > All Places)?

image

You can disable this inspection for now.

image
smarkyun commented 6 months ago

Yes, but the inspection is for all views not just those with custom namespace. Btw The inspection is not the main problem, I have to search for every view usage by name instead of just clicking the icon or using the hotkey

smarkyun commented 6 months ago

Even the main view is unknown

adelf commented 6 months ago

with custom namespace

Your view in the custom namespace? Did you set it in the settings?

image

smarkyun commented 6 months ago

I meant the loadViewsFrom() 2. param is a namespace, but as I said, the plugin cannot recognize the simple view either

smarkyun commented 6 months ago

If i install the legacy deprecated laravel plugin, it can recognize the views normally

adelf commented 6 months ago

That's really weird. So you don't have any loadViewsFrom calls in the project? It has a default Laravel structure and the views aren't recognized?

smarkyun commented 6 months ago

I do have image What I am saying is there are many view (like main.blade.php) calls without any namespace, and those are not working either.

smarkyun commented 6 months ago

The views I am referring to are in the basic laravel structure resources/views folder

adelf commented 6 months ago

does the plugin complete anything in the view('here') call?

smarkyun commented 6 months ago

Yes, It seems only the ones from the loadViewsFrom call

smarkyun commented 6 months ago

Can I provide you any additional information about the issue?

adelf commented 6 months ago

I'm not sure. Could you send all .idea/laravel_* files? Here or adel@laravel-idea.com

smarkyun commented 6 months ago

I fixed the issue. One of the loadViewsFrom call started with '../' instead of __DIR__ . '/'. It is still weird that this prevents the IDE from recognizing views.

adelf commented 6 months ago

Is it in one of the packages or it was your loadViewsFrom?

Yes, my logic is that loadViewsFrom calls override the default settings, since there are a lot of package creators, who overrides the resources/views with own namespace views.

smarkyun commented 6 months ago

It was mine

RicardoAugustoTulio commented 4 months ago

Hello, I saw that you already solved your problem, but the solution you provided didn't work for me. I started looking in the settings and realized that putting a "/" before the views path also solves the problem. image image

adelf commented 4 months ago

@RicardoAugustoTulio

Could you check your settings? Is Laravel directory empty?

image
flavius-constantin commented 2 months ago

Hello, I saw that you already solved your problem, but the solution you provided didn't work for me. I started looking in the settings and realized that putting a "/" before the views path also solves the problem. image image

What the heck? This / just fixed my problem thought. But why do I have projects without the / prefix and it works?

ilkermutlu commented 2 months ago

Can confirm putting a leading slash in default views path resolved it for me too.