Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't know how to check if parameter in [id] #367

Closed
swieckib opened this issue Aug 10, 2016 · 5 comments · Fixed by #410
Closed

Don't know how to check if parameter in [id] #367

swieckib opened this issue Aug 10, 2016 · 5 comments · Fixed by #410
Assignees
Labels
Milestone

Comments

@swieckib
Copy link

Version

4.1.0

Exception

Message

Don't know how to check if parameter

Excerpt

[id]

Line(s) 199-199

Stacktrace

org.elixir_lang.errorreport.Logger.error(Logger.java:48)
org.elixir_lang.errorreport.Logger.error(Logger.java:31)
org.elixir_lang.reference.Callable.isParameter(Callable.java:258)
org.elixir_lang.psi.impl.ElixirPsiImplUtil.getUseScope(ElixirPsiImplUtil.java:2253)
org.elixir_lang.psi.impl.ElixirUnmatchedUnqualifiedNoArgumentsCallImpl.getUseScope(ElixirUnmatchedUnqualifiedNoArgumentsCallImpl.java:89)
com.intellij.psi.impl.search.PsiSearchHelperImpl.getUseScope(PsiSearchHelperImpl.java:79)
com.intellij.psi.search.searches.ReferencesSearch$SearchParameters.getEffectiveSearchScope(ReferencesSearch.java:107)
com.intellij.psi.impl.search.CachesBasedRefSearcher.processQuery(CachesBasedRefSearcher.java:55)
com.intellij.psi.impl.search.CachesBasedRefSearcher.processQuery(CachesBasedRefSearcher.java:21)
com.intellij.openapi.application.QueryExecutorBase.execute(QueryExecutorBase.java:95)
com.intellij.util.ExecutorsQuery.processResults(ExecutorsQuery.java:45)
com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:79)
com.intellij.util.MergeQuery.processSubQuery(MergeQuery.java:85)
com.intellij.util.MergeQuery.forEach(MergeQuery.java:57)
com.intellij.util.UniqueResultsQuery.process(UniqueResultsQuery.java:66)
com.intellij.util.UniqueResultsQuery.forEach(UniqueResultsQuery.java:56)
com.intellij.util.UniqueResultsQuery.findAll(UniqueResultsQuery.java:79)
com.intellij.find.findUsages.FindUsagesHandler.findReferencesToHighlight(FindUsagesHandler.java:176)
com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.a(IdentifierHighlighterPass.java:162)
com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.getHighlightUsages(IdentifierHighlighterPass.java:139)
com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.a(IdentifierHighlighterPass.java:195)
com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.doCollectInformation(IdentifierHighlighterPass.java:106)
com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:434)
com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1034)
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.c(PassExecutorService.java:427)
com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:494)
com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.b(PassExecutorService.java:426)
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:402)
com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:154)
java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
@KronicDeth
Copy link
Owner

@swieckib the excerpt picker didn't give enough context. Can you look at the Attachments tab of the reporter and include at least the surrounding def body?

@KronicDeth
Copy link
Owner

Maybe related to #338

@KronicDeth KronicDeth changed the title [auto-generated] Don't know how to check if parameter in [id] Aug 13, 2016
@halilim
Copy link

halilim commented Sep 1, 2016

Here's how it's happening to me:

in a file:

defmodule Peepchat.SessionController do
  use Peepchat.Web, :controller

  defa
end

defa being the abbreviation of a live template defined as:

def $NAME$(conn, %{$PARAMS$}) do
  $END$
end
  1. Place the cursor after defa and hit tab to autocomplete

  2. The exception is thrown as soon as it's completed as:

    def (conn, %{}) do
    
    end

IDE: RubyMine (build #RM-162.1628.45, 23 Aug 2016 00:00) (2016.2.2)
OS: Mac OS X (10.11.6, x86_64)
JRE: 1.8.0_76-release-b216 (JetBrains s.r.o)
JVM: 25.76-b216 (OpenJDK 64-Bit Server VM)

The usual report:

Version

4.2.0

Exception

Message

Don't know how to check if parameter

Excerpt

(conn, %{})

Line(s) 3-3

Stacktrace

org.elixir_lang.errorreport.Logger.error(Logger.java:48)
org.elixir_lang.errorreport.Logger.error(Logger.java:31)
org.elixir_lang.reference.Callable.isParameter(Callable.java:258)
org.elixir_lang.annonator.Callable.highlight(Callable.java:88)
org.elixir_lang.annonator.Callable.access$000(Callable.java:23)
org.elixir_lang.annonator.Callable$1.visitCall(Callable.java:63)
org.elixir_lang.annonator.Callable$1.visitElement(Callable.java:48)
com.intellij.psi.impl.PsiElementBase.accept(PsiElementBase.java:274)
org.elixir_lang.psi.impl.ElixirMatchedUnqualifiedNoArgumentsCallImpl.accept(ElixirMatchedUnqualifiedNoArgumentsCallImpl.java:39)
org.elixir_lang.annonator.Callable.annotate(Callable.java:39)
com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.a(DefaultHighlightVisitor.java:139)
com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:102)
com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:334)
com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:269)
com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:293)
com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:296)
com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:86)
com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:296)
com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:268)
com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:207)
com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:82)
com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.c(PassExecutorService.java:434)
com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1034)
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:427)
com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:494)
com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.b(PassExecutorService.java:426)
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:402)
com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:154)
java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

@KronicDeth
Copy link
Owner

Very nice report @halilim. Thank you.

@KronicDeth KronicDeth added this to the v4.3.0 milestone Sep 5, 2016
@KronicDeth KronicDeth self-assigned this Sep 5, 2016
@KronicDeth
Copy link
Owner

I can confirm that I can reproduce:

  1. Shift+Cmd+N to make a new scratch file

  2. Pick Elixir

  3. Copy and paste into the scratch file:

    defmodule Peepchat.SessionController do
      use Peepchat.Web, :controller
    
      defa
    end
  4. Copy

    def (conn, %{}) do
    
    end
  5. Highlight defa

  6. Paste

  7. Error logger breakpoint hit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants