KronicDeth / intellij-elixir

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

org.elixir_lang.psi.impl.ElixirUnmatchedUnqualifiedNoParenthesesCallImpl #2424

Open marcellanz opened 2 years ago

marcellanz commented 2 years ago

System

Plugin Version: 12.0.1 Application: IntelliJ IDEA Ultimate Edition (2021.3) Operating System: Mac OS X (12.1)

Event

Exception

Stacktrace

Excerpt

alias Injectx
From: `/Users/lanzm/Documents/Business/marcellanz/eigr/massa/deps/injectx/lib/injectx.ex:8`
To: `/Users/lanzm/Documents/Business/marcellanz/eigr/massa/deps/injectx/lib/injectx.ex:8`

Element Class Name
org.elixir_lang.psi.impl.ElixirUnmatchedUnqualifiedNoParenthesesCallImpl

java.lang.Throwable: StackOverflowError when annotating Call
    at org.elixir_lang.errorreport.Logger.error(Logger.kt:43)
    at org.elixir_lang.errorreport.Logger.error(Logger.kt:25)
    at org.elixir_lang.reference.resolver.Callable.resolveInScope(Callable.kt:103)
    at org.elixir_lang.reference.resolver.Callable.resolve(Callable.kt:88)
    at org.elixir_lang.reference.resolver.Callable.resolveAll(Callable.kt:84)
    at org.elixir_lang.reference.resolver.Callable.resolvePreferred(Callable.kt:74)
    at org.elixir_lang.reference.resolver.Callable.resolve(Callable.kt:39)
    at org.elixir_lang.reference.resolver.Callable.resolve(Callable.kt:35)
    at org.elixir_lang.reference.resolver.Callable.resolve(Callable.kt:30)
    at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolve$1(ResolveCache.java:154)
    at com.intellij.openapi.util.Computable.get(Computable.java:18)

injectx.ex

defmodule Injectx do
  @moduledoc "README.md"
             |> File.read!()
             |> String.split("<!-- MDOC !-->")
             |> Enum.fetch!(1)

  defmacro __using__(opts) do
    quote bind_quoted: [opts: opts] do
      alias Injectx
      import Injectx.Macro

      import Injectx.Context,
        only: [
          inject_all: 1,
          inject_all: 2,
          dispatching: 4,
          dispatching: 5
        ]

      @imports []
      @options opts

      Module.register_attribute(__MODULE__, :inject, accumulate: true)

      @on_definition Injectx
    end
  end

  def __on_definition__(env, _kind, _name, _args, _guards, _body) do
    resolve_injections(env.module)
  end

  defp resolve_injections(module) do
    opts = Module.get_attribute(module, :options)
    injection_points = Module.get_attribute(module, :inject)
    Module.put_attribute(module, :imports, resolve_bindings(opts[:name], injection_points))
  end

  defp resolve_bindings(context_name, injection_points) do
    Enum.map(injection_points, fn injection_point ->
      Injectx.Context.inject(context_name, injection_point)
    end)
  end
end

induced.txt

Following exceptions happened soon after this one, most probably they are induced.

2021-12-28T13:28:34.742
java.util.ServiceConfigurationError: java.nio.charset.spi.CharsetProvider: sun.nio.cs.ext.ExtendedCharsets Unable to get public no-arg constructor
    at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:582)
    at java.base/java.util.ServiceLoader.getConstructor(ServiceLoader.java:673)
    at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:899)
    at java.base/java.util.ServiceLoader$ModuleServicesLookupIterator.hasNext(ServiceLoader.java:1077)
    at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1300)
    at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1385)
    at java.base/java.nio.charset.Charset$1.getNext(Charset.java:344)
    at java.base/java.nio.charset.Charset$1.hasNext(Charset.java:359)
    at java.base/java.nio.charset.Charset$3.run(Charset.java:581)
    at java.base/java.nio.charset.Charset$3.run(Charset.java:571)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.nio.charset.Charset.availableCharsets(Charset.java:570)
    at org.elixir_lang.debugger.stack_frame.value.Presentation.toUtf8String(Presentation.java:194)
    at org.elixir_lang.debugger.stack_frame.value.Presentation.renderBitstr(Presentation.java:140)
    at org.elixir_lang.debugger.stack_frame.value.Presentation.renderObject(Presentation.java:49)
    at org.elixir_lang.debugger.stack_frame.value.Presentation.renderValue(Presentation.java:223)
    at org.elixir_lang.beam.term.InspectKt.inspect(Inspect.kt:10)
    at org.elixir_lang.Macro.otherToString(Macro.kt:193)
    at org.elixir_lang.Macro.toString(Macro.kt:907)
    at org.elixir_lang.Macro$keywordListToString$1.invoke(Macro.kt:204)
    at org.elixir_lang.Macro$keywordListToString$1.invoke(Macro.kt:197)
    at kotlin.text.StringsKt__AppendableKt.appendElement(Appendable.kt:85)
    at kotlin.collections.CollectionsKt___CollectionsKt.joinTo(_Collections.kt:3344)
    at kotlin.collections.CollectionsKt___CollectionsKt.joinToString(_Collections.kt:3361)
    at kotlin.collections.CollectionsKt___CollectionsKt.joinToString$default(_Collections.kt:3360)
    at org.elixir_lang.Macro.keywordListToString(Macro.kt:197)
    at org.elixir_lang.Macro.argumentsToString(Macro.kt:382)
    at org.elixir_lang.Macro.callToStringWithArguments(Macro.kt:481)
    at org.elixir_lang.Macro.otherCallToString(Macro.kt:461)
    at org.elixir_lang.Macro.ifCallToString(Macro.kt:429)
    at org.elixir_lang.Macro.toString(Macro.kt:904)
    at org.elixir_lang.Macro.ifDeinlineToString(Macro.kt:437)
    at org.elixir_lang.Macro.ifCallToString(Macro.kt:428)
    at org.elixir_lang.Macro.toString(Macro.kt:904)
    at org.elixir_lang.beam.chunk.debug_info.v1.elixir_erl.v1.definitions.definition.Clause.toMacroString(Clause.kt:46)
    at org.elixir_lang.beam.chunk.debug_info.v1.elixir_erl.v1.definitions.Definition.toMacroString(Definition.kt:49)
    at org.elixir_lang.beam.Decompiler$Companion.appendMacroNameArity(Decompiler.kt:433)
    at org.elixir_lang.beam.Decompiler$Companion.appendMacroNameArity(Decompiler.kt:406)
    at org.elixir_lang.beam.Decompiler$Companion.appendMacroNameArity(Decompiler.kt:395)
    at org.elixir_lang.beam.Decompiler$Companion.appendCallDefinitions(Decompiler.kt:264)
    at org.elixir_lang.beam.Decompiler$Companion.appendCallDefinitions(Decompiler.kt:214)
KronicDeth commented 2 years ago

🤔 Something is wonky with the generated error report. I think too much information was stripped. I'm not sure I'll be able to track this down unless you can share the repo where it happened and I can reproduce it that way.

marcellanz commented 2 years ago

Sorry for that, I had to strip it, otherwise my browser said that the url openend is too big/long.

ndlarsen commented 2 years ago

Sorry for that, I had to strip it, otherwise my browser said that the url openend is too big/long.

Yeah, this happened to me as well on several occasions.

KronicDeth commented 2 years ago

I’m working on using the GitHub plugin to be able to have users login and be able to use the API to post instead of generating a GET URL that opens the browser like I do now, but the work-around I use myself for GET URLs being too long is to pass the URL to https://www.urldecoder.org/ or another decoder and then paste in the title and body manually since the GitHuB UI form will accept more data than a GET URL.