Closed curtisblackwell closed 4 years ago
Hi,
Namespace comment is required only when the actual Laravel Route group namespace code is not present in the file e.g. Route::namespace('api')->group( function() {
...
This is the case in the default routes/api.php
file.
That's inaccurate. The default routes/api.php
doesn't specify the namespace, the app/Providers/RouteServiceProvider.php
does.
Option + clicking works in routes/web.php
, but no routes/api.php
.
You're right Curtis. RouteServiceProvider specifies the namespace for the api file and our VS Code has no idea about it.
Therefore, I added the feature where we can add a very simple comment // Route::namespace = Api
to the routes/api.php
file and extension will pick it up. I hope it helps.
Would you accept a PR that either 1) was context-aware for the core routes files or 2) allowed disabling this navigating from routes to controllers?
This extension confuses the one I was already using to navigate from routes to controllers and the comments necessary to make this work would end up getting removed.
1) was context-aware for the core routes files
Statically coding the extension for core routes file would prevent users from making changes in their RouteServiceProvider. I think that should be avoided.
2) allowed disabling this navigating from routes to controllers?
Are you using 2 extensions with similar functionalities? I would suggest using only one of them. If there is any feature that is still not implemented in this extension, Please request it - I am open to adding more features, thanks.
Statically coding the extension for core routes file would prevent users from making changes in their RouteServiceProvider. I think that should be avoided.
Okay, so would you accept a PR if this feature could be toggled on/off OR it could be accomplished w/o hard coding it?
Are you using 2 extensions with similar functionalities?
Yeah, that's what I was trying to point out in the original post. laravel-goto-controller already handles the route-linked-to-controller feature the way I prefer. I really only installed your extension for opening logs.
Alright, I think the ability to toggle the feature would be a good addition. Adding it to the TODO list.
PS - The other extension does not support the controller links when you have namespaces the routes using the route group. That is why I developed this extension.
Interesting. I haven't encountered that yet. I don't know the last time I used a custom namespace.
Thanks for reconsidering!
The new version - v1.5.0 has the configuration options to disable features. Please check and let me know if anything :) Cheers.
Was off Laravel projects for a bit, but I finally checked. Working great, thanks!
I've been using this extension for navigating from routes to controllers. It doesn't require adding the namespace comments. It would be great if we could get this feature added.
The extra comments required would likely get removed / be misunderstood by teammates.
P.S. Opening the latest log file with a keyboard shortcut was a genius idea. Thanks!