Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigation using Ctrl + Click for PHP in VSCode

I would like to know if there is a way to enable HyperLink with ctrl-click like PHPStorm and Eclipse for PHP files require_once ("mainfile.php"); include_once ('lib/nusoap/nusoap.php');

And if there is any extension that also allows you to go-to-definition With Eclipse and PhpStorm i can navigate between functions and files easily... The problem is: they're too heavy, so i choose VS Code.

like image 611
Raul Chiarella Avatar asked Nov 20 '25 15:11

Raul Chiarella


1 Answers

I'm developing an extension like this for PHP right now. This can't work in all scenarios as you can use functions or constants when declaring paths. e.g.

MAIN_DIR . get_template_directory() . 'file.php'

And u can get these paths from external resources (even parsing the whole app won't always work). If u have multiple 'file.php' in different directories I can't resolve this.
Edit: the extension will give you now a list of files to choose from.
But if a 'file.php' or 'dir/file.php' relates to only one file I can link it. I'm checking/matching file names and paths with active workspace files.

PHP File Link

like image 116
Paweł Warchoł Avatar answered Nov 23 '25 06:11

Paweł Warchoł