2024-09-07 20:39:22 +02:00
|
|
|
local T = require('toolchain')
|
|
|
|
local M = {}
|
|
|
|
|
2024-09-08 01:50:39 +02:00
|
|
|
function M.setup()
|
2024-09-07 20:39:22 +02:00
|
|
|
T.add_highlighter_autoinstalls('php', 'phpdoc', 'twig')
|
|
|
|
|
|
|
|
T.add_null_ls_module(function(null_ls)
|
|
|
|
return {
|
|
|
|
-- Diagnostics
|
|
|
|
null_ls.builtins.diagnostics.twigcs,
|
|
|
|
-- Formatter
|
|
|
|
null_ls.builtins.formatting.phpcsfixer.with({
|
|
|
|
prefer_local = 'vendor/bin/php-cs-fixer',
|
|
|
|
args = { 'fix', '--allow-risky=yes', '$FILENAME' },
|
|
|
|
}),
|
|
|
|
}
|
|
|
|
end)
|
|
|
|
|
2025-01-13 15:02:43 +01:00
|
|
|
T.add_lsp_autoinstalls(
|
|
|
|
'phpactor',
|
|
|
|
'php-debug-adapter',
|
|
|
|
'twiggy_language_server',
|
|
|
|
'stimulus_ls'
|
|
|
|
)
|
2024-09-07 20:39:22 +02:00
|
|
|
T.add_lsps(function(lspconfig, capabilities)
|
|
|
|
local config = { capabilities = capabilities }
|
|
|
|
lspconfig.phpactor.setup(config)
|
|
|
|
lspconfig.stimulus_ls.setup(config)
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
|
|
|
|
return M
|