nvim-treesitter / nvim-treesitter/nvim-treesitter-textobjects

Prompt a error when open a typescript file.

Open
#209 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Tree-sitter Query
Stars
2.8k
Forks
271
Avg merge
8d 8h
Merged PRs (30d)
1

Description

image
NVIM v0.7.0
Build type: Release
LuaJIT 2.1.0-beta3

When I delete textobjects config part of require("nvim-treesitter.configs").setup(), It works fine. but at the same time there is no corresponding configuration for textobjects.

Here's my textobjects config:

  textobjects = {
    move = {
      enable = true,
      set_jumps = true,
      goto_next_start = {
        ["]x"] = "@attribute.outer",
        ["]i"] = "@import.outer",
        ["]f"] = "@function.outer",
        ["]c"] = "@class.outer",
        ["]d"] = "@declaration.outer",
        ["],"] = "@lhs.inner",
        ["]z"] = "@comment.outer",
      },
      goto_next_end = {
        ["]X"] = "@attribute.outer",
        ["]I"] = "@import.outer",
        ["]F"] = "@function.outer",
        ["]C"] = "@class.outer",
        ["]D"] = "@declaration.outer",
        ["]."] = "@rhs.inner",
        ["]Z"] = "@comment.outer",
      },
      goto_previous_start = {
        ["[x"] = "@attribute.outer",
        ["[i"] = "@import.outer",
        ["[f"] = "@function.outer",
        ["[c"] = "@class.outer",
        ["[d"] = "@declaration.outer",
        ["[,"] = "@lhs.inner",
        ["[z"] = "@comment.outer",
      },
      goto_previous_end = {
        ["[X"] = "@attribute.outer",
        ["[I"] = "@import.outer",
        ["[F"] = "@function.outer",
        ["[C"] = "@class.outer",
        ["[D"] = "@declaration.outer",
        ["[."] = "@rhs.inner",
        ["[Z"] = "@comment.outer",
      },
    },
    select = {
      enable = true,
      lookahead = true,
      keymaps = {
        ["ax"] = "@attribute.outer",
        ["ix"] = "@attribute.inner",

        ["az"] = "@comment.outer",
        ["iz"] = "@comment.outer",

        -- ["at"] = "@tag.outer",
        -- ["it"] = "@tag.inner",

        ["am"] = "@import.outer",
        ["im"] = "@import.inner",

        ["a,"] = "@lhs.outer",
        ["i,"] = "@lhs.inner",
        ["a."] = "@rhs.outer",
        ["i."] = "@rhs.inner",

        ["ad"] = "@declaration.outer",
        ["id"] = "@declaration.inner",

        ["af"] = "@function.outer",
        ["if"] = "@function.inner",
        -- ["aC"] = "@class.outer",
        -- ["iC"] = "@class.inner",

        ["ac"] = "@call.outer",
        ["ic"] = "@call.inner",

        -- ["ao"] = "@block.outer",
        -- ["io"] = "@block.inner",

        ["a;"] = "@block.outer",
        ["i;"] = "@block.inner",

        -- json
        ["ak"] = "@key.outer",
        ["ik"] = "@key.inner",
        ["av"] = "@value.outer",
        ["iv"] = "@value.inner",
      },
    },
  },

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the problem by opening a TypeScript file in Neovim v0.7.0 with the reported textobjects configuration, then compare it with the configuration after removing textobjects. Inspect the error shown in the linked screenshot and confirm that the textobjects configuration works without producing the prompt.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, typescript, vim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.