File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -473,8 +473,10 @@ M.treesitter = function(opts)
473473 opts ._bufname = utils .nvim_buf_get_name (opts .bufnr )
474474 end
475475
476- local ts_parsers = require (" nvim-treesitter.parsers" )
477- if not ts_parsers .has_parser (ts_parsers .get_buf_lang (opts .bufnr )) then
476+
477+ local ft = vim .bo [opts .bufnr ].ft
478+ local lang = vim .treesitter .language .get_lang (ft )
479+ if not utils .has_ts_parser (lang ) then
478480 utils .info (string.format (" No treesitter parser found for '%s' (bufnr=%d)." ,
479481 opts ._bufname , opts .bufnr ))
480482 return
@@ -489,7 +491,7 @@ M.treesitter = function(opts)
489491 coroutine.wrap (function ()
490492 local co = coroutine.running ()
491493 local ts_locals = require (" nvim-treesitter.locals" )
492- for _ , definition in ipairs (ts_locals .get_definitions (opts .bufnr )) do
494+ for _ , definition in ipairs (( ts_locals .get or ts_locals . get_definitions ) (opts .bufnr )) do
493495 local nodes = ts_locals .get_local_nodes (definition )
494496 for _ , node in ipairs (nodes ) do
495497 if node .node then
You can’t perform that action at this time.
0 commit comments