FWDekker / intellij-randomness

IntelliJ plugin for inserting random numbers, UUIDs, names, IP addresses, and much more
https://plugins.jetbrains.com/plugin/9836-randomness
MIT License
45 stars 7 forks source link

IDE Error on find all action (shift shift) #444

Closed programaths closed 1 year ago

programaths commented 2 years ago

Additional info Double shift, then pasting a Kotlin class name and hitting enter

Version information

FWDekker commented 2 years ago

Hiya! Thanks for opening the issue. The issue sound similar to your previous issues (#441, #442), and I suspect it's related to some weird kind of corruption in the Randomness configuration file. Would you be able to share the file at /home/florine/.config/JetBrains/IntelliJIdea2022.2/options/randomness.xml with me so I can inspect the configuration?

programaths commented 2 years ago

Hi, here is the content of the file:

<application>
  <component name="StringSettings">
    <option name="currentScheme">
      <Scheme>
        <option name="myName" value="Default copy" />
      </Scheme>
    </option>
    <option name="currentSchemeName" value="Default copy" />
    <option name="schemes">
      <list>
        <StringScheme>
          <option name="enclosure" value="" />
          <option name="maxLength" value="64" />
          <option name="minLength" value="64" />
        </StringScheme>
        <StringScheme>
          <option name="enclosure" value="" />
          <option name="maxLength" value="70" />
          <option name="minLength" value="70" />
          <option name="myName" value="Default copy" />
        </StringScheme>
      </list>
    </option>
  </component>
</application>

Hope it helps!

FWDekker commented 2 years ago

I was able to reproduce the bug. After some investigation, I found that the cause is the following lines in your randomness.xml:

<option name="currentScheme">
  <Scheme>
    <option name="myName" value="Default copy" />
  </Scheme>
</option>

Removing those lines and then restarting your IDE should resolve the issue. Could you try that out and see if it resolves the issue?

I'm not entirely sure how those lines ended up in the XML, however. The field has been marked as transient, meaning it should not be saved to configuration, and has been marked as transient since schemes were first introduced in v2.4.0.

Either way, I will see if I can make loading settings more resilient in v3, so that errors in the XML are handled gracefully.

FWDekker commented 2 years ago

Hi @programaths. Did either removing randomness.xml or removing the lines mentioned above resolve your issue?

FWDekker commented 1 year ago

Hi @programaths. It's been a while since this issue was active. Have you since then seen this exception repeated? And did removing randomness.xml or removing the lines noted in my previous comment help?

programaths commented 1 year ago

Sorry, to many things going on. You can close this and I will submit a new issue if required.

On Mon, Dec 19, 2022, 14:12 Florine W. Dekker @.***> wrote:

Hi @programaths https://github.com/programaths. It's been a while since this issue was active. Have you since then seen this exception repeated? And did removing randomness.xml or removing the lines noted in my previous comment help?

— Reply to this email directly, view it on GitHub https://github.com/FWDekker/intellij-randomness/issues/444#issuecomment-1357648509, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE6MBKR5Y2PS7TQROXTJVDWOBNLTANCNFSM6AAAAAAQXOJBRE . You are receiving this because you were mentioned.Message ID: @.***>

FWDekker commented 1 year ago

Thank you for the response! Take it easy, and I hope you enjoy the holidays ^^