diff options
| author | Kiyan Yazdani <yazdani.kiyan@protonmail.com> | 2020-04-25 23:33:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-25 23:33:13 +0200 |
| commit | f8b39e1d3ad36c2e5d6eb6f51983275ecc9145f0 (patch) | |
| tree | 6ff340a7c1e243e111bd0e593444eaeca7236741 /lua/nvim-treesitter/locals.lua | |
| parent | 2ca0c348f73655b395ded2e60e13ba0c2249dc74 (diff) | |
| parent | bb709aa8d0e241232b31ca1ae9fc042b16413ffd (diff) | |
Merge pull request #23 from vigoux/feature/textobjects
Node and scope text objects
Diffstat (limited to 'lua/nvim-treesitter/locals.lua')
| -rw-r--r-- | lua/nvim-treesitter/locals.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lua/nvim-treesitter/locals.lua b/lua/nvim-treesitter/locals.lua index 388c7e48..1e19fcd4 100644 --- a/lua/nvim-treesitter/locals.lua +++ b/lua/nvim-treesitter/locals.lua @@ -68,8 +68,8 @@ function M.get_definitions(bufnr) local defs = {} for _, loc in ipairs(locals) do - if loc.definition then - table.insert(defs, {definition=loc.definition, kind=loc.kind}) + if loc.definition and loc.definition.node then + table.insert(defs, {node=loc.definition.node, kind=loc.kind}) end end @@ -82,8 +82,8 @@ function M.get_scopes(bufnr) local scopes = {} for _, loc in ipairs(locals) do - if loc.scope then - table.insert(scopes, loc.scope) + if loc.scope and loc.scope.node then + table.insert(scopes, loc.scope.node) end end @@ -96,8 +96,8 @@ function M.get_references(bufnr) local refs = {} for _, loc in ipairs(locals) do - if loc.reference then - table.insert(refs, loc.reference) + if loc.reference and loc.reference.node then + table.insert(refs, loc.reference.node) end end |
