Help getting PerlNavigator sourcing _.perlcriticrc_ in project directory #113
-
I'm tring to get PerlNavigator setup on my system with NeoVim and I have a question on how the In my NeoVim configs I have the following: -- configure perlnavigator server
lspconfig["perlnavigator"].setup({
cmd = { os.getenv("HOME") .. "/.local/share/nvim/mason/bin/perlnavigator" },
settings = {
perlPath = "perl",
enableWarnings = true,
perltidyProfile = "",
perlcriticProfile = "$workspaceFolder",
perlcriticEnabled = true,
perlimportsLintEnabled = true,
perlimportsTidyEnabled = true,
perlimportsProfile = "",
},
}) But the PerlCritic output that comes from PerlNavigator differs from the output when I manually run I tried leaving the |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 12 replies
-
Do you have a workspace folder configured? I'm not familiar with how neovim defines the "workspace folder". If you turn on logging by setting The other option would be fully pathing the file (e.g. |
Beta Was this translation helpful? Give feedback.
-
I use the complete path to the file depending on what my root directory is (aka my 'project directory'). Although I sometimes use a non-standard name for the file. |
Beta Was this translation helpful? Give feedback.
-
Another piece is that the Navigator does not use the perlcritic profile resolution logic. It does something very similar, but if nothing is found, it will instead use the navigator's default critic profile instead of perlcritic's default. I don't like perlcritic's default settings. For example, if you use subroutine signatures, it falsely alarms about prototypes. This is turned off in the Navigator's default profile. Another alternative if you still have trouble is setting the PERLCRITIC environment variable as the path. And here's the default profile as well: |
Beta Was this translation helpful? Give feedback.
-
As an addendum to my earlier post there should be a workspace configured and it should be the root_dir discovered by |
Beta Was this translation helpful? Give feedback.
-
I can say that this works (assuming a
This works even if I don't automatically set the current working directory to the workspace directory. I didn't notice at first that the OPs config only points to the directory and not to the file. |
Beta Was this translation helpful? Give feedback.
-
Re: turning on logging. Like @bscan said, in your setting set For example here is the output from that command with my setup:
|
Beta Was this translation helpful? Give feedback.
-
Okay, so trying to respond to all the feedback, which thank you for by the way. So as for how my project is structured, I do have the .perlcriticrc file in the root of my project directory:
Running
As for logs from lsp-config, by default there wasn't a lot there:
So I set the loglevel to debug and got this:
As a final note, I have other LSP servers configured, and they are working without issue.
|
Beta Was this translation helpful? Give feedback.
-
@vendion I think you want to set |
Beta Was this translation helpful? Give feedback.
-
@vendion You can turn down the LSP log level. There is no need for debug. INFO will be fine. Make certain |
Beta Was this translation helpful? Give feedback.
-
@vendion I feel stupid for not seeing this earlier, but you need an extra key after
|
Beta Was this translation helpful? Give feedback.
@vendion I feel stupid for not seeing this earlier, but you need an extra key after
settings
. Try this: