Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust: @parameter doesn't work correctly in macros #698

Open
kamack38 opened this issue Oct 6, 2024 · 0 comments
Open

Rust: @parameter doesn't work correctly in macros #698

kamack38 opened this issue Oct 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@kamack38
Copy link

kamack38 commented Oct 6, 2024

Describe the bug
The @parameter.inner and @parameter.outer selectors does not work correctly inside function which are inside a macro.

To Reproduce

assert!(fu^nc("arg"), &r^ef, So^me(4));

Now run dia (Delete @parameter.inner) with cursour in every ^ separately.
The results are:

assert!(("arg"), &ref, Some(4));
assert!(func("arg"), &, Some(4));
assert!(func("arg"), &ref,(4));

Expected behavior

assert!(, &ref, Some(4));
assert!(func("arg"), , Some(4));
assert!(func("arg"), &ref,);

If we remove the shabang (!) and treat it as a function assert, then every keybinding works as expected.

Output of :checkhealth nvim-treesitter

Paste the output here

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

Installation ~

  • WARNING tree-sitter executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
  • OK node found v20.11.1 (only needed for :TSInstallFromGrammar)
  • OK git executable found.
  • OK cc executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: cc (GCC) 14.2.1 20240805
  • 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.10.6-arch1-1.1-g14",
sysname = "Linux",
version = "#1 SMP PREEMPT_DYNAMIC Thu, 29 Aug 2024 07:08:56 +0000"
} ~

Parser/Features H L F I J

  • bash ✓ ✓ ✓ . ✓
  • c ✓ ✓ ✓ ✓ ✓
  • cpp ✓ ✓ ✓ ✓ ✓
  • css ✓ . ✓ ✓ ✓
  • fish ✓ ✓ ✓ ✓ ✓
  • html ✓ ✓ ✓ ✓ ✓
  • hyprlang ✓ . ✓ ✓ ✓
  • javascript ✓ ✓ ✓ ✓ ✓
  • json ✓ ✓ ✓ ✓ .
  • lua ✓ ✓ ✓ ✓ ✓
  • luadoc ✓ . . . .
  • markdown ✓ . ✓ ✓ ✓
  • markdown_inline ✓ . . . ✓
  • nix ✓ ✓ ✓ ✓ ✓
  • norg . . . . .
  • printf ✓ . . . .
  • python ✓ ✓ ✓ ✓ ✓
  • query ✓ ✓ ✓ ✓ ✓
  • rasi ✓ ✓ ✓ ✓ ✓
  • rust ✓ ✓ ✓ ✓ ✓
  • toml ✓ ✓ ✓ ✓ ✓
  • tsx ✓ ✓ ✓ ✓ ✓
  • typescript ✓ ✓ ✓ ✓ ✓
  • typst ✓ . ✓ ✓ ✓
  • vim ✓ ✓ ✓ . ✓
  • vimdoc ✓ . . . ✓
  • yaml ✓ ✓ ✓ ✓ ✓

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.10.1
Build type: Release
LuaJIT 2.1.1723675123
Run "nvim -V1 -v" for more info

Additional context
Add any other context about the problem here.

@kamack38 kamack38 added the bug Something isn't working label Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant