lf-lang / vscode-lingua-franca

Lingua Franca extension for Visual Studio Code
Other
5 stars 3 forks source link

Diagrams not working in VS Code #52

Closed edwardalee closed 2 years ago

edwardalee commented 2 years ago

When I use File->Open in VS code to open an LF file, the diagrams sometimes remain blank, as shown in the screen dump below. There seems to be no way to get them to appear. Also, there is no "show all details" button as in Epoch, which means that when diagrams do get rendered, they are stuck at the top-level view. Clicking on the reactors in the diagram has no effect.

image
petervdonovan commented 2 years ago

I have encountered this behavior accompanied by this error message (in View -> Output -> LF Language Server):

Exception in thread "Thread-0" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite
    at de.cau.cs.kieler.klighd.standalone.KlighdStandaloneSetup.doInitialize(KlighdStandaloneSetup.java:69)
    at de.cau.cs.kieler.klighd.standalone.KlighdStandaloneSetup.initialize(KlighdStandaloneSetup.java:42)
    at de.cau.cs.kieler.klighd.lsp.launch.AbstractLsCreator.buildAndStartLS(AbstractLsCreator.java:117)
    at de.cau.cs.kieler.klighd.lsp.launch.LanguageServerLauncher.start(LanguageServerLauncher.java:63)
    at org.eclipse.xtext.ide.server.ServerLauncher.launch(ServerLauncher.java:48)
    at de.cau.cs.kieler.klighd.lsp.launch.LanguageServerLauncher.launch(LanguageServerLauncher.java:52)
    at de.cau.cs.kieler.klighd.lsp.launch.AbstractLanguageServer.run(AbstractLanguageServer.java:203)
    at de.cau.cs.kieler.klighd.lsp.launch.AbstractLanguageServer$1.run(AbstractLanguageServer.java:90)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Composite
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
    ... 9 more

However, when I rebuilt from master, the error was gone.

Edit: There was a second part to this issue:

Also, there is no "show all details" button as in Epoch, which means that when diagrams do get rendered, they are stuck at the top-level view. Clicking on the reactors in the diagram has no effect.

I have never observed this problem (on Ubuntu). I have a "show all details" button, and clicking on the reactors does have an effect. Could this be a Mac-specific issue, or has it been resolved in the last 21 days? (Edit: Actually, I have observed something like this: If you click on text, the click event is not passed through to the containing diagram element. I seem to recall that Alexander said a fix was coming for that.)

Before the next release, maybe we should reassess whether this issue still exists for anyone.

Edit #2 (July 21): The stack trace I reported was due to a silly bug that is now fixed. I don't think that bug was ever in the main branch nor in any release, so it is irrelevant to this issue.

lhstrh commented 2 years ago

It is assumed that with the new version of KLighD this issue is resolved. Feel free to reopen if this is somehow not the case.