diff options
| author | TravonteD <tman1300@aol.com> | 2020-05-11 11:29:40 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-11 11:29:40 -0400 |
| commit | 73ea03fb8d45378bb4c86cd98371232403a7495a (patch) | |
| tree | 67920137c386b0876a57d7bc08ba4a9743f8881d /lua/nvim-treesitter/locals.lua | |
| parent | b7fdd6ae389e1364b0dda25811ddf566fa508bc3 (diff) | |
| parent | 307c78aa1e2cc5e499469fe892108b7fcf6cdb5e (diff) | |
Merge pull request #1 from nvim-treesitter/master
Updates from master
Diffstat (limited to 'lua/nvim-treesitter/locals.lua')
| -rw-r--r-- | lua/nvim-treesitter/locals.lua | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/lua/nvim-treesitter/locals.lua b/lua/nvim-treesitter/locals.lua index 388c7e48..b16408ac 100644 --- a/lua/nvim-treesitter/locals.lua +++ b/lua/nvim-treesitter/locals.lua @@ -10,22 +10,6 @@ local M = { locals={} } -function M.checkhealth(lang) - local health_start = vim.fn["health#report_start"] - local health_ok = vim.fn['health#report_ok'] - local health_info = vim.fn['health#report_info'] - local health_warn = vim.fn['health#report_warn'] - local health_error = vim.fn['health#report_error'] - - if not queries.get_query(lang, "locals") then - health_warn("No `locals.scm` query found for " .. lang, { - "Open an issue at https://github.com/nvim-treesitter/nvim-treesitter" - }) - else - health_ok("`locals.scm` found.") - end -end - function M.collect_locals(bufnr) local ft = api.nvim_buf_get_option(bufnr, "ft") if not ft then return end @@ -69,7 +53,7 @@ function M.get_definitions(bufnr) for _, loc in ipairs(locals) do if loc.definition then - table.insert(defs, {definition=loc.definition, kind=loc.kind}) + table.insert(defs, loc.definition) end end @@ -82,8 +66,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 +80,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 |
