Skip to content

Commit

Permalink
feat(elixir): support parameterless functions (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanueltouzery committed Jul 11, 2023
1 parent e22facd commit 603ffde
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions queries/elixir/aerial.scm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
(arguments [
(call target: (identifier) @name)
(binary_operator left: (call target: (identifier) @name))
((identifier) @name)
])
(#set! "kind" "Function")
) @type
Expand Down
9 changes: 9 additions & 0 deletions tests/treesitter/elixir_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,15 @@ describe("treesitter elixir", function()
},
},
},
{
kind = "Function",
name = "parameterless_function",
level = 0,
lnum = 68,
col = 0,
end_lnum = 69,
end_col = 3,
},
})
end)
end)
5 changes: 4 additions & 1 deletion tests/treesitter/elixir_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defmodule Example.Module do
defguard public_guard(x) when is_atom(x)

defguard private_guard(x) when is_atom(x)

defmacro public_macro() do
end

Expand Down Expand Up @@ -64,3 +64,6 @@ defmodule StringTest do
end
end
end

def parameterless_function do
end

0 comments on commit 603ffde

Please sign in to comment.