Allow Copy to Clipboard from SOQL Query Results Table

Issue #178 resolved
Stu Forbes created an issue

Hi,

I am unable to copy rows or individual cells from the results table in the SOQL Query panel. I am sure this used to work in a previous version.

Would it be possible to re-add this feature please?

Regards, Stu Forbes

Comments (15)

  1. Scott Wells repo owner

    Stu, I've never explicitly enabled or disabled this behavior. It should just be a feature of the underlying JTable that's used to hold the results. I just ran the following SOQL query:

    SELECT Id, Name
    FROM ApexClass
    ORDER BY Name ASC
    

    and was able to copy the following results to the clipboard:

    01p1a000001mpXUAAY  BasePackageClass
    01p1a000002Xp1BAAS  Demonstration
    01p1a000002Xp2TAAS  DemonstrationClass
    01p1a000002XoUMAA0  DemoTest
    01p1a000002blf3AAA  ExpenseController
    01p1a000001mpXZAAY  ExtensionPackageClass
    01p1a000002YNAfAAO  MyClass
    

    What OS are you using? Can you see if there's any type of error in idea.log? Does the same problem exist even if you restart the IDE?

  2. Stu Forbes reporter

    Hi Scott,

    I'm using OSX El Capitan, Java 8 (Update 66, build 17), and IntelliJ 15

    There doesn't seem to be anything related in the log file, and it persists across restarts.

    Regards, Stu

  3. Stu Forbes reporter

    As a further update to this, standard copy to clipboard using CMD-C doesn't work, but if you choose the 'Copy as Plain Text' option from the Edit menu, that seems to work fine.

    While not ideal, it does work.

  4. Scott Wells repo owner

    That's interesting. Just to clarify, you're saying that this behavior occurs only in the query results table, not in general in IntelliJ IDEA, right? I'll do a little testing on my Mac and see if I can reproduce/understand the issue.

  5. Scott Wells repo owner

    Stu, I just tried this on my Mac and it worked as expected:

    SoqlQueryResultsCopyPaste.png

    I just used CMD+C to perform the copy and pasted directly into TextEdit using CMD+V. This was on OSX El Capitan using Java and IntelliJ 15. There are some known problems running IntelliJ IDEA in JREs other than Apple's own Java 6 JRE:

    https://intellij-support.jetbrains.com/hc/en-us/articles/206827627-IDE-doesn-t-start-after-updating-to-Mac-OS-Yosemite-or-Mavericks

    You might consider moving back down to that JRE and see if it resolves the issue. If you use IntelliJ for Java development, you can still register Java 7/8 SDKs with IntelliJ for those projects even though the IDE itself is running in Java 6.

  6. Stu Forbes reporter

    Scott, I was previously using Oracle JDK 8. I removed all references to Oracle Java, and reinstalled Apple's Java 6. Unfortunately, that didn't resolve the issue.

    CMD-C & CMD-V works elsewhere in IntelliJ. I tested it on the Log tab in the Version Control pane, which was the only other JTable I could find. It appears that that component has a custom Copy event handler though, as the text copied to the clipboard is only the contents of one of the cells.

    Do you know of any other JTable's used in IntelliJ?

    Thanks, Stu

  7. Scott Wells repo owner

    Okay, under Settings>Editor>General, toward the bottom there's Copy as rich text by default. Does toggling that change the behavior? Just trying to see what the difference might be given that now we're both doing this on OSX El Capitan with Apple Java 6 and IntelliJ 15, and it works for me and doesn't for you. There must be some difference.

    Oh, and the answer to your question about JTables in IntelliJ, I don't think so. I think IntelliJ itself is using some other specialized JTable whereas in Illuminated Cloud I'm using JTable directly. There's technically another one in the Illuminated Cloud connection settings screen for Development Packages. I just tried a copy/paste there, and it worked fine as well.

    Let me know...

  8. Stu Forbes reporter

    No luck I'm afraid, tried toggling the checkbox with IDE restarts in between, and still the same problem.

    What's even stranger is that, since rolling back to Java 6, I am no longer able to copy the table rows by using the 'Copy as Plain Text' option either. That was working yesterday, but when trying it now, it keeps what was already on my clipboard instead.

  9. Scott Wells repo owner

    Well that's certainly moving in the wrong direction! Let me do a little more research and see why JTable's standard copy/paste support might stop working. I'll let you know what I find. For what it's worth, I would recommend staying on Apple's Java 6 JRE for other reasons of stability, but I've had users on Oracle's Java 8 say it was working fine, so up to you as to whether you move back for the workaround for now.

  10. Stu Forbes reporter

    Thanks Scott, much appreciated!

    I'm not currently using Java for anything other than the IDE, so will take your advice and stick with Apple Java 6.

  11. Scott Wells repo owner

    I think I've successfully reproduced this on my Mac where it was working fine just yesterday. Let me see what I can find out from that running process.

  12. Scott Wells repo owner

    Okay, I have successfully reproduced it and I believe characterized it. Luckily I still had IntelliJ IDEA 14 on my Mac. Copy/paste in JTables seems to work fine in IDEA 14 but not in 15 specifically on the Mac. Evidently my validation of this yesterday was in 14 when I said it was in 15. I don't know if you were previously in 14 and upgraded, but if so that would explain why it seemed like I removed the feature.

    I'll do a little sleuthing to see why this might have changed. I can definitely see improved cosmetics in my tool windows (SOQL Query, Anonymous Apex, Log Viewer) on the Mac under 15 vs. 14, so something has unquestionably changed across versions. I guess there's a little bad (loss of copy/paste) to go with the good (improved appearance). I'll keep you posted.

  13. Scott Wells repo owner

    Stu, just wanted to provide a quick update. I posted about this in the JetBrains plugin support forums (heavily monitored by the JetBrains development team) and never did get any response. As I mentioned above, it's definitely some type of regression from IDEA 14 to IDEA 15 specifically on the Mac. I haven't tried 15.0.2 to see if that might address it, so that will be my next step. Assuming it doesn't, I want to debug it a bit more and see if I can determine why the copy operation isn't happening. This will likely fall behind a few other items I'm currently working but I do hope to take a look soon.

  14. Stu Forbes reporter

    Scott, I have just retested this myself, and it appears to now be working as expected. I can copy rows from the table using Ctrl-C, and paste using Cmd-V. There have been a number of IntelliJ updates over the last couple of weeks, including one I installed this morning (I'm now on IntelliJ 15.0.2, build IC-143.1184).

  15. Scott Wells repo owner

    Stu, that's great to hear, and not entirely surprising. Seeing as how that appeared to be a platform-specific regression from IDEA 14 to 15, and seeing as how I posted about it in a forum closely monitored by JetBrains developers, I can see how it'd be quickly addressed. I'm going to resolve this, but please let me know if it comes back.

  16. Log in to comment