Maybe it's better to use that feature instead of doing something similar in getAllDeclarationsInTree. That way the language server is less depending on the language and doesn't need to know specifics of the tree grammar itself.
For example the server can test for the generic @definition.function instead of the very specific node name function_definition.
Tree-Sitter has a Code Navigation Systems used for tagging.
Maybe it's better to use that feature instead of doing something similar in getAllDeclarationsInTree. That way the language server is less depending on the language and doesn't need to know specifics of the tree grammar itself.
For example the server can test for the generic
@definition.function
instead of the very specific node namefunction_definition
.To test this https://github.com/OpenModelica/tree-sitter-modelica needs to implement this feature, see https://github.com/OpenModelica/tree-sitter-modelica/issues/15.