nvim-treesitter / nvim-treesitter-textobjects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to jump to custom text objects of injected languages.

peri4n opened this issue · comments

Describe the bug
I am unable to jump to text objects from an injected language.

To be specific: Inside a markdown file I want to jump to an inline_link node.

From my understanding, the markdown treesitter grammar is split into markdown and markdown_inline.
I am able to jump to a custom capture with inline_link once I set the filetype to markdown_inline but this breaks my setup.

To Reproduce
Steps to reproduce the behavior:

  1. Open a markdown file
  2. Create a custom capture like: (inline_link (link_text)@link.inner)@link.outer
  3. See that you can't jump to link.inner or link.outer

Expected behavior
A clear and concise description of what you expected to happen.

Output of :checkhealth nvim-treesitter

nvim-treesitter: require("nvim-treesitter.health").check()

Installation ~

  • WARNING tree-sitter executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
  • WARNING node executable not found (only needed for :TSInstallFromGrammar, not required for :TSInstall)
  • OK git executable found.
  • OK cc executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: gcc (GCC) 12.3.0
  • OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

OS Info:
{
machine = "x86_64",
release = "6.1.37",
sysname = "Linux",
version = "#1-NixOS SMP PREEMPT_DYNAMIC Sat Jul 1 11:16:27 UTC 2023"
} ~

Parser/Features H L F I J

  • ada ✓ ✓ ✓ . .
  • agda ✓ . ✓ . .
  • arduino ✓ ✓ ✓ ✓ ✓
  • astro ✓ ✓ ✓ ✓ ✓
  • awk ✓ . . . ✓
  • bash ✓ ✓ ✓ . ✓
  • bass ✓ ✓ ✓ ✓ ✓
  • beancount ✓ . ✓ . .
  • bibtex ✓ . ✓ ✓ .
  • bicep ✓ ✓ ✓ ✓ ✓
  • blueprint ✓ . . . .
  • c ✓ ✓ ✓ ✓ ✓
  • c_sharp ✓ ✓ ✓ . ✓
  • capnp ✓ ✓ ✓ ✓ ✓
  • chatito ✓ ✓ ✓ ✓ ✓
  • clojure ✓ ✓ ✓ . ✓
  • cmake ✓ . ✓ ✓ .
  • comment ✓ . . . .
  • commonlisp ✓ ✓ ✓ . .
  • cooklang ✓ . . . .
  • corn ✓ ✓ ✓ ✓ .
  • cpon ✓ ✓ ✓ ✓ ✓
  • cpp ✓ ✓ ✓ ✓ ✓
  • css ✓ . ✓ ✓ ✓
  • cuda ✓ ✓ ✓ ✓ ✓
  • cue ✓ ✓ ✓ ✓ ✓
  • dart ✓ ✓ ✓ ✓ ✓
  • devicetree ✓ ✓ ✓ ✓ ✓
  • dhall ✓ . ✓ . ✓
  • diff ✓ . . . .
  • dockerfile ✓ . . . ✓
  • dot ✓ . . . ✓
  • ebnf ✓ . . . .
  • eex ✓ . . . ✓
  • elixir ✓ ✓ ✓ ✓ ✓
  • elm ✓ . . . ✓
  • elsa ✓ ✓ ✓ ✓ ✓
  • elvish ✓ . . . ✓
  • embedded_template ✓ . . . ✓
  • erlang ✓ . ✓ . .
  • fennel ✓ ✓ ✓ . ✓
  • firrtl ✓ ✓ ✓ ✓ ✓
  • fish ✓ ✓ ✓ ✓ ✓
  • foam ✓ ✓ ✓ ✓ ✓
  • fortran ✓ . ✓ ✓ .
  • fsh ✓ . . . .
  • func ✓ . . . .
  • fusion ✓ ✓ ✓ ✓ .
  • gdscript ✓ ✓ ✓ ✓ ✓
  • git_config ✓ . . . .
  • git_rebase ✓ . . . ✓
  • gitattributes ✓ . . . ✓
  • gitcommit ✓ . . . ✓
  • gitignore ✓ . . . .
  • gleam ✓ ✓ ✓ ✓ ✓
  • glimmer ✓ ✓ ✓ ✓ .
  • glsl ✓ ✓ ✓ ✓ ✓
  • go ✓ ✓ ✓ ✓ ✓
  • godot_resource ✓ ✓ ✓ . .
  • gomod ✓ . . . ✓
  • gosum ✓ . . . .
  • gowork ✓ . . . ✓
  • graphql ✓ . . ✓ ✓
  • groovy ✓ . . . ✓
  • hack ✓ . . . .
  • hare ✓ ✓ ✓ ✓ ✓
  • haskell ✓ . ✓ . ✓
  • haskell_persistent ✓ . ✓ . .
  • hcl ✓ . ✓ ✓ ✓
  • heex ✓ ✓ ✓ ✓ ✓
  • hjson ✓ ✓ ✓ ✓ ✓
  • hlsl ✓ ✓ ✓ ✓ ✓
  • hocon ✓ . . . ✓
  • hoon ✓ ✓ ✓ . .
  • html ✓ ✓ ✓ ✓ ✓
  • htmldjango ✓ . ✓ ✓ ✓
  • http ✓ . . . ✓
  • ini ✓ . ✓ . .
  • ispc ✓ ✓ ✓ ✓ ✓
  • janet_simple ✓ ✓ ✓ . ✓
  • java ✓ ✓ ✓ ✓ ✓
  • javascript ✓ ✓ ✓ ✓ ✓
  • jq ✓ . . . ✓
  • jsdoc ✓ . . . .
  • json ✓ ✓ ✓ ✓ .
  • json5 ✓ . . . ✓
  • jsonc ✓ ✓ ✓ ✓ ✓
  • jsonnet ✓ . . . .
  • julia ✓ ✓ ✓ ✓ ✓
  • kdl ✓ ✓ ✓ ✓ ✓
  • kotlin ✓ ✓ ✓ . ✓
  • lalrpop ✓ ✓ . . ✓
  • latex ✓ . ✓ . ✓
  • ledger ✓ . ✓ ✓ ✓
  • llvm ✓ . . . .
  • lua ✓ ✓ ✓ ✓ ✓
  • luadoc ✓ . . . .
  • luap ✓ . . . .
  • luau ✓ ✓ ✓ ✓ ✓
  • m68k ✓ ✓ ✓ . ✓
  • make ✓ . ✓ . ✓
  • markdown ✓ . ✓ ✓ ✓
  • markdown_inline ✓ . . . ✓
  • matlab ✓ ✓ ✓ ✓ ✓
  • menhir ✓ . . . ✓
  • mermaid ✓ . . . .
  • meson ✓ . ✓ . ✓
  • nickel ✓ . . ✓ .
  • ninja ✓ . ✓ ✓ .
  • nix ✓ ✓ ✓ . ✓
  • norg . . . . .
  • objc ✓ ✓ ✓ ✓ ✓
  • ocaml ✓ ✓ ✓ ✓ ✓
  • ocaml_interface ✓ ✓ ✓ ✓ ✓
  • odin ✓ ✓ ✓ ✓ ✓
  • org . . . . .
  • pascal ✓ ✓ ✓ ✓ ✓
  • passwd ✓ . . . .
  • pem ✓ . ✓ . ✓
  • perl ✓ . ✓ . ✓
  • php ✓ ✓ ✓ ✓ ✓
  • phpdoc ✓ . . . .
  • pioasm ✓ . . . ✓
  • po ✓ . ✓ . ✓
  • poe_filter ✓ . ✓ ✓ ✓
  • pony ✓ ✓ ✓ ✓ ✓
  • prisma ✓ . . . .
  • proto ✓ . ✓ . .
  • prql ✓ . . . ✓
  • pug ✓ . . . ✓
  • puppet ✓ ✓ ✓ ✓ ✓
  • python ✓ ✓ ✓ ✓ ✓
  • ql ✓ ✓ ✓ ✓ ✓
  • qmldir ✓ . . . ✓
  • qmljs ✓ . ✓ . .
  • query ✓ ✓ ✓ ✓ ✓
  • r ✓ ✓ . ✓ ✓
  • racket ✓ . ✓ . ✓
  • rasi ✓ ✓ ✓ ✓ .
  • regex ✓ . . . .
  • rego ✓ . . . ✓
  • rnoweb ✓ . ✓ . ✓
  • ron ✓ ✓ ✓ ✓ ✓
  • rst ✓ ✓ . . ✓
  • ruby ✓ ✓ ✓ ✓ ✓
  • rust ✓ ✓ ✓ ✓ ✓
  • scala ✓ ✓ ✓ . ✓
  • scheme ✓ . ✓ . ✓
  • scss ✓ . ✓ ✓ .
  • slint ✓ . . ✓ .
  • smali ✓ ✓ ✓ ✓ ✓
  • smithy ✓ . . . .
  • solidity ✓ . . . .
  • sparql ✓ ✓ ✓ ✓ ✓
  • sql ✓ . . ✓ ✓
  • squirrel ✓ ✓ ✓ ✓ ✓
  • starlark ✓ ✓ ✓ ✓ ✓
  • supercollider ✓ ✓ ✓ ✓ ✓
  • surface ✓ . ✓ ✓ ✓
  • svelte ✓ . ✓ ✓ ✓
  • sxhkdrc ✓ . ✓ . ✓
  • t32 ✓ ✓ ✓ ✓ ✓
  • tablegen ✓ ✓ ✓ ✓ ✓
  • terraform ✓ . ✓ ✓ ✓
  • thrift ✓ ✓ ✓ ✓ ✓
  • tiger ✓ ✓ ✓ ✓ ✓
  • tlaplus ✓ ✓ ✓ . ✓
  • todotxt ✓ . . . .
  • toml ✓ ✓ ✓ ✓ ✓
  • tsx ✓ ✓ ✓ ✓ ✓
  • turtle ✓ ✓ ✓ ✓ ✓
  • twig ✓ . . . ✓
  • typescript ✓ ✓ ✓ ✓ ✓
  • ungrammar ✓ ✓ ✓ ✓ ✓
  • usd ✓ ✓ ✓ ✓ .
  • uxntal ✓ ✓ ✓ ✓ ✓
  • v ✓ ✓ ✓ ✓ ✓
  • vala ✓ . ✓ . .
  • verilog ✓ ✓ ✓ . ✓
  • vhs ✓ . . . .
  • vim ✓ ✓ ✓ . ✓
  • vimdoc ✓ . . . ✓
  • vue ✓ . ✓ ✓ ✓
  • wgsl ✓ . ✓ ✓ .
  • wgsl_bevy ✓ . ✓ ✓ .
  • yaml ✓ ✓ ✓ ✓ ✓
  • yang ✓ . ✓ ✓ ✓
  • yuck ✓ ✓ ✓ ✓ ✓
  • zig ✓ . ✓ ✓ ✓

Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
+) multiple parsers found, only one will be used
x) errors found in the query, try to run :TSUpdate {lang}

Output of nvim --version

NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/nix/store/ypc27qm8i9vp96yh1wk5aq3giibyi1f4-neovim-unwrapped-0.9.1/share/nvim
"

Additional context
Add any other context about the problem here.