Skip to content

Unable to autocomplete/hover macro in Phoenix Project  #1124

@u4d3rc0v3r

Description

@u4d3rc0v3r

The project is running in VSCode devcontainer

Sample Code

defmodule AppWeb.PageController do
  use AppWeb, :controller

  def home(conn, _params) do
    # The home page is often custom made,
    # so skip the default app layout.
    render(conn, :home, layout: false)
  end
end
defmodule AppWeb do
   @spec controller() :: {:__block__, [], [{:import, [...], [...]} | {:use, [...], [...]}, ...]}
  def controller do
    quote do
      use Phoenix.Controller,
        formats: [:html, :json],
        layouts: [html: AppWeb.Layouts]

      import Plug.Conn
      import AppWeb.Gettext

      unquote(verified_routes())
    end
  end
  • Elixir & Erlang versions (elixir --version):
    elixir 1.17.3/OTP 27
  • Elixir Language Server version:
    ElixirLS v0.24.1
  • Operating system:
    MacOS
  • Editor or IDE name (e.g. Emacs/VSCode):
    VSCode

Elixir-LS Log

[Warn  - 11:40:30 AM] Unable to expand macro AppWeb.__using__/1: ** (FunctionClauseError) no function clause matching in AppWeb.__using__/1
    (app 0.1.0) expanding macro: AppWeb.__using__/1
    nofile:2: AppWeb.PageController (module)

Reproduction steps

  1. install elixir-ls in VSCode
  2. Create fresh project using mix phx.new app

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions