Closed Allaman closed 3 weeks ago
The problem here is that tree-sitter based textobjects from gen_spec.treesitter()
need proper language query files to work. They do not come with 'mini.ai' directly, but should be handled separately by the user. The currently easiest way to do so is to just install 'nvim-treesitter-textobjects' without enabling its functionality. For more information see help for gen_spec.treesitter()
.
This particular reproduction example can be resolved by updating installed plugins to be the following:
local plugins = {
"folke/tokyonight.nvim",
"nvim-treesitter/nvim-treesitter",
"nvim-treesitter/nvim-treesitter-textobjects",
"echasnovski/mini.ai",
}
Thank you for the explanation. Adding nvim-treesitter-texobjects does the job.
Contributing guidelines
Module(s)
mini.ai
Description
Hi! I want to migrate from treesitter-textobjects to mini.ai. However, I can't get @function.inner and @function.outer to work. This drives me crazy. Any help/hint is much appreciated
Minimal not working config:
Neovim version
v0.11.0-dev-4684+gae0d56264-Homebrew
Steps to reproduce
nvim -nu minimal.lua main.go
Write some Golang code:
Then inside the main func hit
dif
ordaf
.This treesitter-textobjects config works with the same Go code:
Expected behavior
Operate on the outer/inner function
Actual behavior
(mini.ai) No textobject "af" found covering region within 500 lines and
search_method = 'cover_or_next'
. (mini.ai) No textobject "if" found covering region within 500 lines andsearch_method = 'cover_or_next'
.