Neovim Php Namespace Resolver
- Feels better then intelephense & phpactor features
Treesitter php updates might break the plugin if plugin doesn't behave as normal report the as issue.
:GetClasses
Finds all classes, traits, implementations, attributes, from composer or from local search:GetClass
gets class under cursor:ClassAs
class As -- gets class under cursor or on empty:Namespace
generates namespace
{ -- lazy
'ccaglak/namespace.nvim',
keys = {
{ "<leader>la", "<cmd>GetClasses<cr>"},
{ "<leader>lc", "<cmd>GetClass<cr>"},
{ "<leader>ls", "<cmd>ClassAs<cr>"},
{ "<leader>ln", "<cmd>Namespace<cr>"},
},
dependencies = {
"nvim-lua/plenary.nvim"
}
}
{ -- lazy
ft = { 'php' },
'ccaglak/namespace.nvim',
keys = {
{ '<leader>lc', '<cmd>lua require("namespace.getClass").get()<cr>', { desc = 'GetClass' } },
{ '<leader>la', '<cmd>lua require("namespace.getClasses").get()<cr>', { desc = 'GetClasses' } },
{ "<leader>ls", '<cmd>lua require("namespace.classAs").open()<cr>', { desc = 'ClassAs' } },
{ "<leader>ln", '<cmd>lua require("namespace.namespace").gen()<cr>', { desc = 'Generate Namespace' } },
},
dependencies = {
"nvim-lua/plenary.nvim"
}
}
vim.keymap.set("n", "<leader>la", "<cmd>GetClasses<cr>")
vim.keymap.set("n", "<leader>lc", "<cmd>GetClass<cr>")
vim.keymap.set("n", "<leader>ls", "<cmd>ClassAs<cr>")
vim.keymap.set("n", "<leader>ln", "<cmd>Namespace<cr>")
- pleanery.nvim
- nvim-treesitter (
:TSInstall php json
) - brew install ripgrep
-- needs to be cleanup/refactored
-- add missing method/class etc
- no known bugs
- Let me know if you have any edge cases
- PhpTools phptools.nvim.
- Laravel Goto Blade/Components larago.nvim.
- by VSCode Php Namespace Resolver