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

Create IntelliJ plugin #41

Open
karoliineh opened this issue Sep 21, 2022 · 2 comments
Open

Create IntelliJ plugin #41

karoliineh opened this issue Sep 21, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@karoliineh
Copy link
Member

No description provided.

@karoliineh karoliineh added the enhancement New feature or request label Sep 21, 2022
@karoliineh karoliineh self-assigned this Sep 21, 2022
@michael-schwarz
Copy link
Member

I think while this is nice to have, I don't think we need to focus on this too much for now.

@karoliineh
Copy link
Member Author

Creating the plugin "technically works".

IntelliJ

But it is quite broken:

  • Setting the Goblint switch manually prior to opening the project in the IDE, which we currently do with VS Code, does not work with IntelliJ. Therefore for the plugin to work, I had to hardcode the Goblint path into the plugin. The possible solution that came to my mind is to have an optional field in the GobPie configuration for either the switch or goblint path, so when this is given, either the switch is set before running Goblint or Goblint is run from the given path. This approach would also improve the usability of VS Code plugin because then the switch can be set once in the configuration, and one does not forget to set it themselves each time before opening a project.
  • For some reason, the problems are only shown in the editor and not in the problems list window.
  • When hovering the warnings, the details are only shown for a fraction of a second and then it runs into an exception, showing also a warning saying that "The IDE is running low on memory and this might affect performance".
    Stacktracejava.lang.NullPointerException: Cannot invoke "com.intellij.openapi.ui.popup.Balloon.dispose()" because the return value of "magpiebridge.intellij.client.LanguageClient.access$400(magpiebridge.intellij.client.LanguageClient)" is null at magpiebridge.intellij.client.LanguageClient$2$1.onClosed(LanguageClient.java:398) at com.intellij.ui.BalloonImpl.lambda$hideAndDispose$4(BalloonImpl.java:1073) at com.intellij.ui.BalloonImpl$9.dispose(BalloonImpl.java:943) at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:126) at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:158) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:217) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:205) at com.intellij.ui.BalloonImpl$9.paintCycleEnd(BalloonImpl.java:935) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:749) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:918) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:766) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:450) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:791) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:449) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105) at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:624) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:447) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:493) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Although I will not dive into the causes of these issues and try and fix them asap, I will leave this issue open, so I will not forget to fix them eventually.


Meanwhile, if anyone wants to try it (but mostly for documentation to myself, so I would not have to remember it all), the current steps for creating and running the plugin are:

  1. Replace goblint in GobPie class GoblintServer.java method constructGoblintRunCommand() with absolute path
  2. Generate the .jar as usual.
  3. (if on Mac) add exp.cpp-path to goblint.json, because it is unable to locate the right cpp itself when ran from IntelliJ.
  4. Install IntelliJLSP as documented in the repository.
  5. Configure the language server:
    • set Jar file path to the generated GobPie .jar
    • set Working directory to the project (to-be-analysed) root.

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

No branches or pull requests

2 participants