Open harrisonmg opened 2 years ago
yeah, the current implementation doesn't work on all cases, I think we can make use of the list of definitions we already have in locals.scm https://github.com/nvim-treesitter/nvim-treesitter/pull/566#issuecomment-706605306
Since nvim-treesitter intends to remove this module in the future, I have forked my fix #6803 into a new plugin at https://github.com/QikLiang/ts-statusline.nvim
I'm working in a C++ codebase that often makes multiline node declarations, such as
and have found that this results in
M.statusline
just returning"void"
for that node.I don't understand treesitter in detail, but my first idea was to increase how many lines
M.statusline
uses for each node and pair down the result via:gsub
. That worked ok, but obviously it's quite hacky and prone to a few undesired behaviors. E.g. if your cursor is overMavlinkParametersManager
, treesitter seems to think both the first and second lines are nodes, soM.statusline
returnsNext, I looked for some kind of node name property to use instead, but I'm not sure if there is one.
It's unclear to me if this is a shortcoming of treesitter or this plugin, but I looking for advice on how to help improve this functionality.
Thanks!