I’m trying to add symbols to the nova-elixir-ls extension which uses tree-sitter. The symbols.scm
file in the extension looks like it came directly from the project that adds Elixir support to GitHub so I assume it’s correct.
I’ve added <symbols />
in the <tree-sitter>
section of Elixir.xml
and now I’m trying to add something like (#set! role function)
so that the symbols will show up in the Symbols sidebar. Here’s example change that has no effect:
Original:
; * functions/macros
(call
target: (identifier) @ignore
(arguments
[
; zero-arity functions with no parentheses
(identifier) @name
; regular function clause
(call target: (identifier) @name @displayname)
; function clause with a guard clause
(binary_operator
left: (call target: (identifier) @name)
operator: "when")
])
(#match? @ignore "^(def|defp|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp)$")) @definition.function
Changed:
; * functions/macros
(call
target: (identifier) @ignore
(arguments
[
; zero-arity functions with no parentheses
(identifier) @name
; regular function clause
(call target: (identifier) @name @displayname)
; function clause with a guard clause
(binary_operator
left: (call target: (identifier) @name)
operator: "when")
])
(#match? @ignore "^(def|defp|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp)$")
(#set! role function)) @definition.function
Any ideas? Debugging hints?