Psalm diagnostic source for none-ls.nvim.
Since this diagnostic was deprecated from none-ls.nvim (see this issue) because a LSP alternative is available, this repository allows to keep using psalm linter with none-ls.nvim.
Note: This plugin is not intended to be used alone, it is a dependency of none-ls.nvim.
This should be used as a dependency of none-ls.nvim.
{
{
"nvimtools/none-ls.nvim",
dependencies = {
"gbprod/none-ls-php.nvim",
},
},
}
Follow the steps in null-ls setup section.
local null_ls = require("null-ls")
null_ls.setup {
sources = {
require("none-ls-psalm.diagnostics"),
...
}
}
You can search for sources via the none-ls-sources
topic.
How to trigger the formatter only if the project is using psalm?
null_ls.register(require("none-ls-psalm.diagnostics").with({
condition = function(utils)
return utils.root_has_file("psalm.xml")
end,
}))
How to use project's psalm bin instead of globally installed one?
null_ls.register(require("none-ls-psalm.diagnostics").with({
command = "vendor/bin/psalm",
condition = function(utils)
return utils.root_has_file("vendor/bin/psalm")
end,
}))