Giter Site home page Giter Site logo

Comments (15)

artemrakov avatar artemrakov commented on May 21, 2024 2

Sorry, my bad. Didn't install TreeSitter parser (TSIntall) :D. After installation, it worked.

:TSTextobjectSelect @function.outer actually showed me the error. Thanks @theHamsta

from nvim-treesitter-textobjects.

artemrakov avatar artemrakov commented on May 21, 2024 1

Did anyone manage to solve this bug? Select does not work for me as well

from nvim-treesitter-textobjects.

Nimmidev avatar Nimmidev commented on May 21, 2024 1

@sozomon i had the problem because i put the config in the lua/plugin directory instead of after/plugin. Now everything works.

from nvim-treesitter-textobjects.

theHamsta avatar theHamsta commented on May 21, 2024

So none of the combinations daf (delete a function) vaf (select a function) would work for? Not even the go-to commands?

from nvim-treesitter-textobjects.

kvietcong avatar kvietcong commented on May 21, 2024

Yes, none of those work. It just puts me into visual mode (no cursor movement) or waits for a text object. The go tos dont work either

from nvim-treesitter-textobjects.

dmatos2012 avatar dmatos2012 commented on May 21, 2024

@kvietcong did you fix this? It happens to me as well sometimes, although for me swap doenst work, but move does. I dont think I changed anything.

from nvim-treesitter-textobjects.

kvietcong avatar kvietcong commented on May 21, 2024

@dmatos2012 Sadly I have not been able to fix this. I haven't tested this yet but this might be a Windows problem. I'll have to test it out on Linux later

from nvim-treesitter-textobjects.

johnybx avatar johnybx commented on May 21, 2024

I have same problem. I defined mapping with config below but swap and lsp_interop are not defined at all - cannot see it in mappings. select and Only move seem to work fine ๐Ÿค”

	textobjects = {
		select = {
			enable = true,

			-- Automatically jump forward to textobj, similar to targets.vim
			lookahead = true,

			keymaps = {
				-- You can use the capture groups defined in textobjects.scm
				["af"] = "@function.outer",
				["if"] = "@function.inner",
				["ac"] = "@class.outer",
				["ic"] = "@class.inner",
			},
		},
		move = {
			enable = true,
			set_jumps = true, -- whether to set jumps in the jumplist
			goto_next_start = {
				["]m"] = "@function.outer",
				["]]"] = "@class.outer",
			},
			goto_next_end = {
				["]M"] = "@function.outer",
				["]["] = "@class.outer",
			},
			goto_previous_start = {
				["[m"] = "@function.outer",
				["[["] = "@class.outer",
			},
			goto_previous_end = {
				["[M"] = "@function.outer",
				["[]"] = "@class.outer",
			},
		},
		swap = {
			enable = true,
			swap_next = { ["<leader>z"] = "@parameter.inner" },
			swap_previous = { ["<leader>Z"] = "@parameter.inner" },
		},
		lsp_interop = {
			enable = true,
			border = "none",
			peek_definition_code = {
				["<leader>df"] = "@function.outer",
				["<leader>dF"] = "@class.outer",
			},
		},
}

from nvim-treesitter-textobjects.

kvietcong avatar kvietcong commented on May 21, 2024

Yeah even after removing swap and lsp_interop, it sadly doesn't work

from nvim-treesitter-textobjects.

n3wborn avatar n3wborn commented on May 21, 2024

Same for me, lsp_interop peek_definition doesn't work since many days now :/
selection is ok though

--- https://github.com/nvim-treesitter/nvim-treesitter

require('nvim-treesitter.configs').setup({
    ensure_installed = 'maintained',
    highlight = {
        enable = true,
    },
    playground = {
        enable = false,
    },
    indent = {
        enable = true,
    },
    textobjects = {
        lsp_interop = {
            enable = true,
            border = 'rounded',
            peek_definition_code = {
                ['df'] = '@function.outer',
                ['dF'] = '@class.outer',
            },
        },
        select = {
            enable = true,
            lookahead = true,
            keymaps = {
                ['af'] = '@function.outer',
                ['if'] = '@function.inner',
                ['ac'] = '@class.outer',
                ['ic'] = '@class.inner',
            },
        },
        move = {
            enable = true,
            set_jumps = true,
            goto_next_start = {
                [']m'] = '@function.outer',
                [']]'] = '@class.outer',
            },
            goto_next_end = {
                [']M'] = '@function.outer',
                [']['] = '@class.outer',
            },
            goto_previous_start = {
                ['[m'] = '@function.outer',
                ['[['] = '@class.outer',
            },
            goto_previous_end = {
                ['[M'] = '@function.outer',
                ['[]'] = '@class.outer',
            },
        },
    },
    autopairs = {
        enable = true, -- check for autopairs (see nvim-autopairs)
    },
    -- https://github.com/nvim-treesitter/nvim-treesitter-refactor
    refactor = {
        highlight_definitions = {
            enable = true,
        },
        smart_rename = {
            enable = true,
            keymaps = {
                smart_rename = 'R',
            },
        },
        navigation = {
            enable = true,
            keymaps = {
                goto_definition_lsp_fallback = 'gnd',
                list_definitions = 'gnD',
                list_definitions_toc = 'gO',
                goto_next_usage = '<a-*>',
                goto_previous_usage = '<a-ยต>',
            },
        },
    },
})

from nvim-treesitter-textobjects.

theHamsta avatar theHamsta commented on May 21, 2024

@artemrakov Even, :TSTextobjectSelect @function.outer wouldn't work for you?

from nvim-treesitter-textobjects.

Nimmidev avatar Nimmidev commented on May 21, 2024

I have the same problem. With the defaullt config taken from the README neither daf, dif, vaf or any other binding works. Running :TSTextobjectSelect @function.outer directly does work as intended.

from nvim-treesitter-textobjects.

SollyCB avatar SollyCB commented on May 21, 2024

^^ Yep, same issue. Command works. But binds from the readme are broke.

from nvim-treesitter-textobjects.

SollyCB avatar SollyCB commented on May 21, 2024

@Nimmidev Fixed after reinstalling treesitter cargo cli. Idk why it did not work on last reinstall

from nvim-treesitter-textobjects.

kiyoon avatar kiyoon commented on May 21, 2024

Closing as many people resolved the issue. Feel free to reopen

from nvim-treesitter-textobjects.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.