Issue getting [comment node] on current cursor position with Treesitter API's get_node_at_cursor()

This page summarizes the projects mentioned and recommended in the original post on /r/neovim

Our great sponsors
  • Onboard AI - ChatGPT with full context of any GitHub repo.
  • WorkOS - The modern API for authentication & user identity.
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • neovim

    Vim-fork focused on extensibility and usability

  • Comment.nvim

    :brain: :muscle: // Smart and powerful comment plugin for neovim. Supports treesitter, dot repeat, left-right/up-down motions, hooks, and more

  • Onboard AI

    ChatGPT with full context of any GitHub repo. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at

  • nvim-treesitter

    Nvim Treesitter configurations and abstraction layer

    I think the issue here is that ts_utils.get_node_at_cursor() is getting the node from an inject language tree. In this case, the injected language is comment. This is fixed by a change I got merged in which adds an ignore_injected_langs parameter so you can call it like ts_utils.get_node_at_cursor(0, true)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts