nvim-treesitter / nvim-treesitter/nvim-treesitter-context
Expose API to replace the open/close functions
Nobody has claimed this yet.
- Dominant language
- Janet
- Stars
- 3.2k
- Forks
- 241
- PR merge metrics
- No merged PRs in 30d
Description
I would like to display the treesitter context a little differently - in a winbar via other plugins like LuaLine or Feline. Those plugins already provide you with the custom sections where you can put any arbitrary text, and this text in my case would be the treesitter context hierarchy.
Would it be possible to allow overriding the built-in open/close function? When a user-supplied function is specified, then the plugin will not draw any UI.
Example:
require'treesitter-context'.setup{
-- ...
on_open = function(ctx)
-- ctx here is for example an array of items to display, it could have some additional properties as needed.
end,
on_close = function()
end,
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the plugin's built-in open and close functions and the setup configuration that controls them. Implement the requested callback configuration so supplied functions receive the context or close event and prevent the plugin from drawing its own UI; done means the context can be consumed by winbar plugins without built-in rendering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100