Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Breaks "Laravel goto view" extension #103

Open
addtobag opened this issue Dec 20, 2024 · 11 comments
Open

[Bug]: Breaks "Laravel goto view" extension #103

addtobag opened this issue Dec 20, 2024 · 11 comments
Assignees
Labels

Comments

@addtobag
Copy link

Extension Version

0.1.14

PHP Binary

Herd

Operating System

macOS

What happened?

Once installed, the Laravel goto view (https://github.com/codingyu/laravel-goto-view) breaks. Keeps asking to create the view file rather than opening it the file that already exists.

image

Mimimal Code Sample

No response

@mikebronner
Copy link

@addtobag I believe you can disable the Laravel Goto View extension, as the Laravel extension should be able do this for you going forward. I just tested this in a controller, and it takes me directly to the view using only the Laravel extension (and the goto extension disabled).

@N1ebieski
Copy link
Contributor

@mikebronner for me, Laravel extension links directly to blade view only in .php files such as controllers, livewire component classes etc.

But not in blade files so I can't disable goto view extension. For example:

Without goto view extension:

without

With goto view extension:

with

@mikebronner
Copy link

@N1ebieski gotcha, I thought you had trouble getting to the view from php, instead the issue seems to be with loading blade component views. Thanks for clarifying.

@N1ebieski
Copy link
Contributor

N1ebieski commented Dec 20, 2024

I'm not an author this issue. I just wanted to point out that I (and probably other users) can't disable the "go to view" extension as you suggest.

@mikebronner
Copy link

mikebronner commented Dec 20, 2024

I use this goto component extension alongside the Laravel extension and it works: https://marketplace.visualstudio.com/items?itemName=ctf0.laravel-goto-component, perhaps this will help others also facing this issue.

@addtobag
Copy link
Author

addtobag commented Dec 20, 2024

@addtobag I believe you can disable the Laravel Goto View extension, as the Laravel extension should be able do this for you going forward. I just tested this in a controller, and it takes me directly to the view using only the Laravel extension (and the goto extension disabled).

Hi Mike, thanks for the response. With GoTo view extension disabled, i have the same issue. If i create the file, it then creates it within the application folder structure but using my local folder directories e.g.

image

@joetannenbaum
Copy link
Collaborator

To summarize:

  • This extension is conflicting with goto view, not much I can do there, but you are able to turn off the individual features of this extension as you need to (search for "view" in settings and uncheck conflicting items)
  • We are otherwise having an issue with missing views created in the wrong directory, is that correct @addtobag? Even with the other extensions disabled?

@vmind
Copy link

vmind commented Jan 12, 2025

@joetannenbaum
Hi, I have disabled all Laravel extensions and only kept the official one.
When I try to open a Livewire view file, the extension creates a new file on the C drive (kept Linux catalog structure /var/ww/....) instead of in WSL2.

@addtobag
Copy link
Author

Hi @joetannenbaum

I’ve disabled all Laravel-related extensions, restarted, and reinstalled the official Laravel extension. However, like @vmind, when I click on a view (whether within a Livewire component or a Controller), it prompts me to create the file instead of navigating to the correct one.

Surely this must be a configuration issue? As mentioned in my previous message, it’s creating the file and folder structure within the project.

Thanks,
Ross

@erblinbobaj
Copy link

erblinbobaj commented Jan 20, 2025

Hi everyone,

I encountered the same issue with the "follow links" configuration, but it only occurred in a project where I hadn't updated Laravel yet.

After some debugging, I discovered that in earlier versions of Laravel, config_path('/') would return a path with double slashes. Here's an example:

> config_path('/');
> "/Users/mypc/code/config//"

> config_path('app.php');
> "/Users/mypc/code/config/app.php"

> config_path('/app.php');
> "/Users/mypc/code/config//app.php"

> config_path();
> "/Users/mypc/code/config"

> base_path('/');
> "/Users/mypc/code//"

> base_path();
> "/Users/mypc/code"

The extra slashes were causing the "follow link" issue.

@macCesar
Copy link

macCesar commented Feb 4, 2025

It's true that the goto function from the official extension does NOT work in older projects (Laravel 8)... I know it does work in Laravel 10!

In this screenshot, you can see both links—the one at the top is from the official extension, and the one at the bottom is from Laravel Goto View...

Only the goto link works in Laravel 8 projects!!

Notice that the file name does not include .blade.php, though they might just be simplifying the path.

In Laravel 8, I get the same results as @erblinbobaj when testing the base_path function :-(

Hope that helps!!

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants