diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2020-07-10 22:17:51 +0200 |
|---|---|---|
| committer | Thomas Vigouroux <39092278+vigoux@users.noreply.github.com> | 2020-07-16 09:34:31 +0200 |
| commit | 8cf2dc7f9ad31c7467d28f90aec920018e240b7f (patch) | |
| tree | 3cfa3df9bc6aef2006b2bd6ec0fed530ffece02c /lua/nvim-treesitter/refactor/smart_rename.lua | |
| parent | a4e2692c7b9fb562eca39ce0bb10ec2544bc7ccb (diff) | |
Refactor locals.lua:
- shared query group stuff -> query.lua
- local-specific stuff from ts_utils -> locals.lua
Diffstat (limited to 'lua/nvim-treesitter/refactor/smart_rename.lua')
| -rw-r--r-- | lua/nvim-treesitter/refactor/smart_rename.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lua/nvim-treesitter/refactor/smart_rename.lua b/lua/nvim-treesitter/refactor/smart_rename.lua index e5ee37ac..ad26085c 100644 --- a/lua/nvim-treesitter/refactor/smart_rename.lua +++ b/lua/nvim-treesitter/refactor/smart_rename.lua @@ -2,6 +2,7 @@ -- Can be used directly using the `smart_rename` function. local ts_utils = require'nvim-treesitter.ts_utils' +local locals = require'nvim-treesitter.locals' local configs = require'nvim-treesitter.configs' local utils = require'nvim-treesitter.utils' local api = vim.api @@ -23,8 +24,8 @@ function M.smart_rename(bufnr) -- Empty name cancels the interaction or ESC if not new_name or #new_name < 1 then return end - local definition, scope = ts_utils.find_definition(node_at_point, bufnr) - local nodes_to_rename = ts_utils.find_usages(node_at_point, scope) + local definition, scope = locals.find_definition(node_at_point, bufnr) + local nodes_to_rename = locals.find_usages(node_at_point, scope) if not vim.tbl_contains(nodes_to_rename, node_at_point) then table.insert(nodes_to_rename, node_at_point) |
