mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat(angular): Better rename override
Since the keys provided only applied on server attached, so I assumed this is safe (cmiiw). And with this renaming using angularls will behave much similar to vscode. Following some results I tested: - rename variable in `xxx.component.ts` >> `xxx.component.html` will also reflect - rename variable in `xxx.component.html` >> `xxx.component.ts` will also reflect - rename variable component in `xxx.component.ts` >> inline view template will also relfected & vise versa But please note that this will disable the html capabilities of renaming (similar to vscode), so renaming html element name won't work.
This commit is contained in:
parent
2fd07da9a8
commit
f365fe5270
1 changed files with 14 additions and 6 deletions
|
|
@ -37,12 +37,20 @@ return {
|
|||
root_dir = function(root_dir)
|
||||
return require("lspconfig.util").root_pattern(unpack(angular_root_pattern))(root_dir)
|
||||
end,
|
||||
angularls = function()
|
||||
LazyVim.lsp.on_attach(function(client)
|
||||
--HACK: disable angular renaming capability due to duplicate rename popping up
|
||||
client.server_capabilities.renameProvider = false
|
||||
end, "angularls")
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>cr",
|
||||
function()
|
||||
vim.lsp.buf.rename(nil, {
|
||||
filter = function(client)
|
||||
return client.name == "angularls"
|
||||
end,
|
||||
})
|
||||
end,
|
||||
desc = "Rename",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue