Skip to content

fix(julia): parameter and short-form function queries - #905

Open
melyso wants to merge 2 commits into
nvim-treesitter:mainfrom
melyso:melyso-fix-julia-queries
Open

melyso wants to merge 2 commits into
nvim-treesitter:mainfrom
melyso:melyso-fix-julia-queries

Conversation

@melyso

@melyso melyso commented Sep 24, 2026

Copy link
Copy Markdown

The query for arguments in function argument lists was malformed, inadvertently grouping two queries that should have been separate. By adopting the form already used for tuple expressions, the patterrn also matches single-argument function calls, which the previous pattern would not have. Furthermore, the query for short-form function definitions did not match if a where clause was present.

If preferable, the alternation in the short-form query correction is easily substituted by two separate queries.

Tested with:

  • NVIM v0.12.5 (LuaJIT 2.1.1788856981)
  • nvim-treesitter-textobjects: main
  • nvim-treesitter: main
  • tree-sitter-julia: e04970e

Verified with :EditQuery that both patterns match the intended
nodes, and that the @parameter and @function text objects and motions behave correctly.

The two argument_list patterns were wrapped in an extra paren pair, making them a single grouped pattern requiring two consecutive sibling argument_list nodes (which never occurs), so @parameter never matched function arguments. Replaced them with the two-pattern form already used for tuple_expression, which additionally handles single-argument calls that the comma-anchored patterns could not match.
The short-form pattern failed to match cases with a where clause. The alternation ensures that the pattern now matches cases both with and without a where clause.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant