Using define in Orion editor plugin [message #1575663] |
Tue, 20 January 2015 23:39 |
Brian Payton Messages: 154 Registered: July 2009 |
Senior Member |
|
|
I'm writing an Orion editor plugin to support styling and validation for a language not currently supported in Orion (that is, SQL). I'd like to follow the patterns of the many built-in Orion editor language extensions, in that they all use the "define" function (AMD pattern) to modularize those extensions. However I can't get "define" to work in my editor plugin. If I use define, I always get the dreaded "plug-in handshake timeout" error, and my plugin doesn't install. So I'm doing something wrong (or not doing something right), but I don't know what.
The editor plugin documentation mentions (in https://wiki.eclipse.org/Orion/Documentation/Developer_Guide/Simple_plugin_example, "What you need" section) that you can use "require" with a module loader loader like RequireJS. (Incidentally, shouldn't that be "define", not "require"?) But I don't find any real plugin example code that does that.
So if someone can point me to a complete editor plugin example that uses the AMD pattern, or otherwise give me some tips for making this work, I'd appreciate it.
By the way, when an Orion plugin fails to install, is there any error log entry generated anywhere with a more specific reason than "handshake timeout"? The generic error message makes it quite hard to diagnose the problem.
|
|
|
Re: Using define in Orion editor plugin [message #1585902 is a reply to message #1575663] |
Mon, 26 January 2015 14:59 |
Mark Macdonald Messages: 35 Registered: July 2009 |
Member |
|
|
Hi Brian,
Here is an example plugin that uses AMD:
Also, check out these troubleshooting tips for installing plugins, which I recently added to the wiki: Troubleshooting plugin installation
In my experience, the biggest issue with AMD is getting the module paths ("orion/Deferred", "orion/plugin", etc) to resolve correctly. If you still can't get it to work, try using plain old <script> tags instead.
Quote:By the way, when an Orion plugin fails to install, is there any error log entry generated anywhere with a more specific reason than "handshake timeout"? The generic error message makes it quite hard to diagnose the problem.
When this error occurs, it means that Orion opened an iframe for the plugin, but the plugin did not call back within the timeout period. I'm not sure if it's possible for us to detect exactly what caused the failure (there are many different possible causes, as the troubleshooting steps imply). But I'll open a feature request to investigate.
|
|
|
|
|
Re: Using define in Orion editor plugin [message #1797527 is a reply to message #1575663] |
Thu, 01 November 2018 08:14 |
arnald pirotty Messages: 3 Registered: November 2018 |
Junior Member |
|
|
Brian Payton wrote on Tue, 20 January 2015 23:39I'm writing an Orion editor plugin to support styling and validation for a language not currently supported in Orion (that is, SQL). I'd like to follow the patterns of the many built-in Orion editor language extensions, in that they all use the "define" function (AMD pattern) to modularize those extensions. However I can't get "define" to work in my editor plugin. If I use define, I always get the dreaded "plug-in handshake timeout" error, and my plugin doesn't install. So I'm doing something wrong (or not doing something right), but I don't know what.
The editor plugin documentation mentions (in https://wiki.eclipse.org/Orion/Documentation/Developer_Guide/Simple_plugin_example, "What you need" section) that you can use "require" with a module loader loader like RequireJS. (Incidentally, shouldn't that be "define", not "require"?) But I don't find any real plugin example code that does that.
So if someone can point me to a complete editor plugin example that uses the AMD pattern, or otherwise give me some tips for making this work, I'd appreciate it.
By the way, when an Orion plugin fails to install, is there any error log entry generated anywhere with a more specific reason than "handshake timeout"? The generic error message makes it quite hard to diagnose the problem.
When this error occurs, it means that Orion opened an iframe for the plugin, but the plugin did not call back within the timeout period. I'm not sure if it's possible for us to detect exactly what caused the failure (there are many different possible causes, as the troubleshooting steps imply). But I'll open a feature request to investigate.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04493 seconds