Closed ognjen-vuceljic closed 2 months ago
Do you use PMD v6 or v7? If you use v6, it should be straightforward, manually run pmd
in your console to see if it exists in the $PATH. Your error message seems to imply it is missing at the moment.
If you use v7, none-ls looks for a "pmd" executable, which corresponds to "pmd check" in v7. To address this, you can create a bash script and place it in your $PATH for none-ls to invoke.
To test the result, when you run "pmd" manually in the console now, you will actually be executing this bash script, which runs "pmd check" as a wrapper and attach your inputs.
#!/usr/bin/env bash
path/to/pmd/bin/pmd check "$@"
I'm currently using v6, but this setting worked for me for v7.
Thank you @xixiaofinland
I am almost there, but a few final steps are missing.
Apologies, I didn't understand the following part:
If you use v7, none-ls looks for a "pmd" executable, which corresponds to "pmd check" in v7. To address this, you can create a bash script and place it in your $PATH for none-ls to invoke.
pmd.sh
, or it has to be something else)?Basically, the part I didn't catch was where exactly, and how, to create the script. My understanding is that it needs to be a .sh
file with the content from message above, and to be put in a particular folder.
Btw, this is what I am getting at the moment
PMD may have even run against this file, but no diagnostic messages are shown.
Many thanks for the help!
you need to name the bashscript as pmd
without suffix, and put it into one of your $PATH directories, explanation.
By doing this, in console you can call pmd
from anywhere, just like other globally installed tools node
, npm
etc.
I suggest you understand what $PATH does first. None-ls is simply invoking pmd
with parameters defined in the configuration.
If you can run the same commands in console successfully, none-ls should be ok too. If no, then dig a bit deeper.
Thank you @xixiaofinland , will take a look.
I think we can close this issue!
Hello!
I'm not sure if this is the best place to post such a question, but looking at dotfiles and neovim config, I tried replicating some of the items in order to add PMD to my Salesforce project.
I looked at this discussion and tried applying the mentioned fixes, but had no luck.
Once I added the following part to
none-ls.lua
pluginthe following error was received
Could you, please, let me know what the configuration issue might be?
Appreciate the help!
@xixiaofinland