elixir-lang / tree-sitter-elixir

Elixir grammar for tree-sitter
https://elixir-lang.org/tree-sitter-elixir
Apache License 2.0
248 stars 25 forks source link

Remote function calls wrongly pointing to local function #26

Closed fertapric closed 2 years ago

fertapric commented 2 years ago

Navigating GitHub today I discovered that in this case the remote function call does not properly point to the proper module, it points to a local function defined inside the module.

Screen Shot 2022-02-14 at 17 39 27

the-mikedavis commented 2 years ago

This is a limitation of "search-based" code-navigation on GitHub: all definitions/references for functions/modules of the same name are given, even in cases like this where two functions have the same name but are actually separate. See the search vs. precise docs from GitHub.

We'll need to implement stack-graphs queries to solve this (and other scenarios like references to aliased modules). Stack-graphs are quite new, though - they're only implemented for python so far. Afaik, GitHub is currently in the process of open-sourcing and improving documentation on it.

josevalim commented 2 years ago

Yes, that’s working as intended by the current version of search based navigation. Precise navigation will solve that but not currently available.

Also Keep in mind the code navigation does not work across projects either (so it only finds definitions within a project).