wende / autocomplete-elixir

Intelligent Elixir autocompletion provider for Atom autocomplete-plus
MIT License
42 stars 11 forks source link

Wrong errors in Phoenix project #22

Closed Hades32 closed 9 years ago

Hades32 commented 9 years ago

Channels in Phoenix typically start with someting like this:

# myproject/lib/game_channel.ex
defmodule Square.GameChannel do
  use Square.Web, :channel

This compiles and works just fine but autocomplete-elixir gives Errors: "module Square.Web is not loaded and could not be found at line 2".

My Square.Web module Looks like this:

# myproject/web/web.ex
defmodule Square.Web do
  def controller do
    quote do
      use Phoenix.Controller
      alias Square.Repo
      import Square.Router.Helpers
    end
  end

  def view do
    quote do
      use Phoenix.View, root: "web/templates"
      import Phoenix.Controller, only: [get_csrf_token: 0, get_flash: 2, view_module: 1]
      import Square.Router.Helpers
      use Phoenix.HTML
    end
  end

  def router do
    quote do
      use Phoenix.Router
    end
  end

  def channel do
    quote do
      use Phoenix.Channel
      alias Square.Repo
    end
  end

  defmacro __using__(which) when is_atom(which) do
    apply(__MODULE__, which, [])
  end
end
wende commented 9 years ago

I think this isn't related to this plugin but linter-elixirc instead ;) Autocomplete-elixir doesn't display any errors. And yeah. I've got the same issue with 'use' keyword in linter-elixirc

Hades32 commented 9 years ago

:D Ups

mintuhouse commented 8 years ago

@Hades32 Did you find a fix for this? I am facing similar issue. Edit: Thanks found it here