bscan / PerlNavigator

Perl Language Server that includes syntax checking, perl critic, and code navigation
MIT License
198 stars 39 forks source link

Is it possible to open modules directly (path is from Cygwin)? #128

Open lishengting opened 5 months ago

lishengting commented 5 months ago

image

Just as showed in the picture. Is it possible to open the module File::Basename: \usr\share\perl5\5.36\File\Basename.pm directly in a new tab? BTW, the path is from Cygwin. When I click "Go to Definition (F12)", it shows "No definition found for 'Basename'".

Thanks!

bscan commented 5 months ago

Hi @lishengting, currently this is not supported. Perl only knows about the cygwin path and has no way to translate it into a path that vscode understands. I use WSL2 instead, which works extremely well with the WSL extension. I highly recommend WSL if that is an option.

Otherwise, for this to work, I could add a variable that would allow mapping of paths from Perl reported to vscode (e.g. maps / -> c:\Cywgin\). This could also be helpful for people who run a containerized Perl, do syntax checking over SSH, or use WSL without the WSL extension.

lishengting commented 5 months ago

Otherwise, for this to work, I could add a variable that would allow mapping of paths from Perl reported to vscode (e.g. maps / -> c:\Cywgin\). This could also be helpful for people who run a containerized Perl, do syntax checking over SSH, or use WSL without the WSL extension.

Yes, this is what I wish. Something like "perl.pathMap": [ [ "file:///", "file:///D:/cygwin64/" ] ] in Perl::LanguageServer.

Hope you have time to implement this feature. Thanks!