Skip to content

Conversation

@katafrakt
Copy link
Owner

This complements katafrakt/elixir_sense#1 by un-skipping the existing test and adding one more case, which I did not cover initially.

It add working go-to-definition for situations, when a function is defined by a macro in its __using__, for example:

defmodule MyApp.Repo do
  use Ecto.Repo

  def all_but_first(schema) do
    [_ | tail] = al|l(schema)
    tail
  end
end

When editor invokes go-to-definition in the place marked by a pipe, it will go to Ecto.Repo's source file to the line defining the all function.

Similarly, when we have MyApp.Repo.al|l(Thing), it will jump to the same place in the Ecto.Repo's source file.

@katafrakt katafrakt force-pushed the support-function-defined-in-__using__ branch 2 times, most recently from 8f2e252 to 14e3172 Compare November 24, 2025 11:57
@katafrakt katafrakt changed the title Support go to definition when function defined in __using__ feat(engine): support go to definition when function defined in __using__ Nov 24, 2025
@katafrakt katafrakt force-pushed the support-function-defined-in-__using__ branch 2 times, most recently from 58d1fdb to e49da0f Compare November 24, 2025 12:37
…ng__

This make sure we find definition when having an "Ecto.Repo-like"
situation, when we call a function from a module (`Repo.all`) and `Repo`
module has `use Ecto.Repo`, which actually defines the function in its
`__using__` macro.
@katafrakt katafrakt force-pushed the support-function-defined-in-__using__ branch 2 times, most recently from 98b895e to 2efbd14 Compare December 19, 2025 10:29
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.

2 participants