KronicDeth / intellij-elixir

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)
Other
1.84k stars 153 forks source link

Resolve qualified macros that use alias setup by `require` `as:` argument. #1229

Open memoyil opened 6 years ago

KronicDeth commented 6 years ago

Going to need more information than that:

  1. Where were the macros defined? In your own code? Ones from a dependencies? From the SDK?
  2. Which IDE are you using the plugin in?
  3. Do you have an SDK setup AND assigned to the project.
memoyil commented 6 years ago

First of all, I mean the code completion doesn't work with macros.

Macros defined in my own code. I am using intellij idea. I have an elixir 1.6.5 and erlang 20 sdk assigned to that project.

KronicDeth commented 6 years ago

Can you share a repository that reproduces the problem? Are the macros defined with defmacro and defmacrop in another module, the same module, or indirectly using other macros, such as inside a quote block?

memoyil commented 6 years ago
defmodule Macro.Module do
  defmacro example_macro, do: "example"
end
require Macro.Module as: MC

defmodule Example do

  def example_method(_params) do
     MC.exam....  **This cannot be auto completed or identified**
  end

end
KronicDeth commented 6 years ago

Oh, this changes everything. There's no support for :as on require in the reference resolver. Only alias is used to resolve qualifiers currently. We'll change this to a feature request to support require's as. I never use it personally, so it's never come up before.

cowst commented 6 years ago

Hi @KronicDeth, how do you prioritize new features? Can we upvote somehow to show interest in particular ones, for example this? :)