symfony routes source for nvim-cmp
- plenary.nvim is required
{
"fbuchlak/cmp-symfony-router",
dependencies = { "nvim-lua/plenary.nvim" }
},
Add symfony_router
as cmp source
require("cmp").setup {
sources = {
{
name = "symfony_router",
-- these options are default, you don't need to include them in setup
option = {
console_command = { "php", "bin/console" }, -- see Configuration section
cwd = nil, -- string|nil Defaults to vim.loop.cwd()
cwd_files = { "composer.json", "bin/console" }, -- all these files must exist in cwd to trigger completion
filetypes = { "php", "twig" },
}
},
},
}
Defines symfony console executable
-- examples
{ "bin/console" } -- call console executable directly
{ "symfony", "console" } -- using symfony cli
{ "docker", "exec", "CONTAINER_NAME", "php", "bin/console" } -- docker
{ "docker", "compose", "exec", "SERVICE_NAME", "php", "bin/console" } -- docker compose