KronicDeth / intellij-elixir

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

Don't know how to find variable use scope for MapUpdateArguments #517

Closed tizpuppi closed 7 years ago

tizpuppi commented 7 years ago

Version

4.6.0

Description

this message appears when writing this line of code: true = :ets.delete(monitors, pid)

Exception

Message

Don't know how to find variable use scope

Excerpt

state | workers: [pid|wokers]

Line(s) 67-67

Element Class Name

org.elixir_lang.psi.impl.ElixirMapUpdateArgumentsImpl

Stacktrace


org.elixir_lang.errorreport.Logger.error(Logger.java:47)
org.elixir_lang.errorreport.Logger.error(Logger.java:30)
org.elixir_lang.reference.Callable.error(Callable.java:334)
org.elixir_lang.reference.Callable.variableUseScope(Callable.java:537)
org.elixir_lang.reference.Callable.variableUseScope(Callable.java:524)
org.elixir_lang.reference.Callable.variableUseScope(Callable.java:524)
org.elixir_lang.reference.Callable.variableUseScope(Callable.java:524)
org.elixir_lang.reference.Callable.variableUseScope(Callable.java:524)
org.elixir_lang.reference.Callable.variableUseScope(Callable.java:430)
org.elixir_lang.reference.Callable.variableUseScope(Callable.java:531)
org.elixir_lang.reference.Callable.variableUseScope(Callable.java:524)
org.elixir_lang.reference.Callable.variableUseScope(Callable.java:326)
org.elixir_lang.psi.impl.ElixirPsiImplUtil.getUseScope(ElixirPsiImplUtil.java:2575)
org.elixir_lang.psi.impl.ElixirUnmatchedUnqualifiedNoArgumentsCallImpl.getUseScope(ElixirUnmatchedUnqualifiedNoArgumentsCallImpl.java:102)
com.intellij.psi.impl.search.PsiSearchHelperImpl.getUseScope(PsiSearchHelperImpl.java:77)
com.intellij.psi.search.searches.ReferencesSearch$SearchParameters.getEffectiveSearchScope(ReferencesSearch.java:111)
com.intellij.psi.impl.search.CachesBasedRefSearcher.processQuery(CachesBasedRefSearcher.jav
KronicDeth commented 7 years ago

@tizpuppi can you give me the full function around state | workers: [pid|wokers]? It will be needed for the regression test.

tizpuppi commented 7 years ago

Dear Luke,

I was typing this https://github.com/benjamintanweihao/the-little-elixir-otp-guidebook-code/blob/master/chapter_7/pooly/version-1/lib/pooly/server.ex, specifically function:

def handle_cast({:checkin, worker}, %{workers: workers, monitors: monitors} = state) do case :ets.lookup(monitors, worker) do [{pid, ref}] -> true = Process.demonitor(ref) true = :ets.delete(monitors, pid) {:noreply, %{state | workers: [pid|workers]}} [] -> {:noreply, state} end end thank you

On Wed, Nov 16, 2016 at 4:21 AM, Luke Imhoff notifications@github.com wrote:

Assigned #517 https://github.com/KronicDeth/intellij-elixir/issues/517 to @tizpuppi https://github.com/tizpuppi.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/KronicDeth/intellij-elixir/issues/517#event-860445511, or mute the thread https://github.com/notifications/unsubscribe-auth/AQsPH5kzhCmNRjMOkziRPwFqmoEgXQv3ks5q-na0gaJpZM4KyfVw .

Tiziano Puppi

KronicDeth commented 7 years ago

I can reproduce by deleted the r in the worker variable on https://github.com/benjamintanweihao/the-little-elixir-otp-guidebook-code/blob/master/chapter_7/pooly/version-1/lib/pooly/server.ex#L73. Thanks @tizpuppi