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

navigator fails to find modules in lib/perl5/x86_64-linux/ #69

Open
Deracination opened this issue May 8, 2023 · 3 comments
Open

navigator fails to find modules in lib/perl5/x86_64-linux/ #69

Deracination opened this issue May 8, 2023 · 3 comments

Comments

@Deracination
Copy link

I have the Mouse.pm and Imager.pm modules installed via local::lib which installs in local_lib/lib/perl5/x86_64-linux/

The navigator reports any modules in x86_64-linux as unknown and needing to be installed.

Configuration is:

    "perlnavigator.perlPath": "/opt/perlbrew/perls/perl-5.34.0/bin/perl",
    "perlnavigator.includePaths": [
        "$workspaceFolder/local_lib",
        "$workspaceFolder/code",
    ],
    "perlnavigator.perltidyProfile": "/home/dev/.perltidyrc",
    "perlnavigator.perlcriticEnabled": false,
    "perlnavigator.includeLib": false,
    "perlnavigator.enableWarnings": false,
@Deracination
Copy link
Author

Using a wrapper for Perl as follows and perltidy now works but there is no navigation support - no definitions:

#!/bin/bash

# FindBin for bash!
readonly Bin=$(cd -- "$(dirname "$0")" && pwd)

/opt/perlbrew/perls/perl-5.34.0/bin/perl -Mlocal::lib=${Bin}/../local_lib $@
"perlnavigator.perlPath": "/home/dev/work/util/perl_run"

language server log shows:

Starting perl compilation check with the equivalent of: /home/dev/work/util/perl_run -c -Mwarnings -M-warnings=redefine -I /home/dev/work/code -I /home/dev/work/treeplan/perl -I /home/dev/.vscode-server/extensions/bscan.perlnavigator-0.5.5/server/src/perl -MInquisitor /home/dev/work/code/DMS/SiteUtils.pm
Compilation Time: 0.031 seconds
[Trace - 4:05:54 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///home/dev/work/code/DMS/SiteUtils.pm",
    "diagnostics": []
}


[Trace - 4:05:54 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///home/dev/work/code/DMS/SiteUtils.pm",
    "diagnostics": []
}

@bscan
Copy link
Owner

bscan commented May 8, 2023

Hi @Deracination, perhaps you can try adding the full path of the perl modules to your includePaths? Something like:

"perlnavigator.includePaths": [
        "/home/Deracination/local_lib/lib/perl5/x86_64-linux/",

In any case, you can usually get more info by manually running the "equivalent of" command shown. The navigator runs something slightly different because it needs to pass the code over stdin (since the file modifications may not be saved yet), but it's close enough. Including -MInquisitor causes it to dump symbols from the symbol table that are used for navigation purposes. You could leave that argument out if just checking to see if modules are found and the code compiles.

/home/dev/work/util/perl_run -c -Mwarnings -M-warnings=redefine -I /home/dev/work/code -I /home/dev/work/treeplan/perl -I /home/dev/.vscode-server/extensions/bscan.perlnavigator-0.5.5/server/src/perl -MInquisitor /home/dev/work/code/DMS/SiteUtils.pm

If none of this works, you may need #68, which allows passing arguments to the perl executable. I think many people want that feature for docker, local::lib, WSL, Carton, etc. I just need to finish reviewing it and then push a new release.

@Deracination
Copy link
Author

Thanks, I'll watch for the new release

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

No branches or pull requests

2 participants