Philip Lawrence

Adding Code Completion for Adobe Launch Extension Developers

Introduction
Adding Code Completion for Adobe Launch Extension Developers

If you've done any extension development for Adobe Launch, you've likely used the turbine and extensionBridge objects in some way. If you haven't dabbled in building an extension and you use Launch, I highly recommend trying it out.  For a quick reference, the turbine object is a "free variable" that provides a handful of properties about the extension and Launch property, as well as a few helper methods. The extensionBridge object is used to communicate settings and validation between the extension's UI and Launch's UI, as well as adding a few additional UI helpers. You can learn more about these objects over on the Adobe Launch Developer Docs.

When I was developing the Gtag extension, I was constantly referring back to the documentation to see the exact name of a property I wanted to grab, the order of arguments to pass into the turbine methods, and the names of the methods on the extensionBridge object. I primarily use JetBrain's WebStorm IDE when developing front end work, and like most modern IDEs, WebStorm has fantastic type hinting and code completion features that I constantly use. In order to make use of this, the original objects need to exist in the project. In the case of building a Launch extension, we don't pull in the full Launch engine or any of the free variables injected into our extension. However, you can add code libraries to fill in the gap, thus, the turbine dummy was born!

You can see below that the various methods and properties are now hinted and can make development a lot easier within WebStorm:

Who are you calling a "dummy"?!

If you've done any type of automated testing before, you've probably heard of the terms "stubs", "mocks", "fakes", and "dummies". They all do similar things, but they each have their own use case. A "dummy" is simply a placeholder. It doesn't add any functionality, it cannot be called by called, but it can be referenced. There isn't an exact term for what we're doing, so a dummy is close enough.

If you're interested in learning more about the other terms, I recommend checking out the documentation over at xUnit Patterns. It might be an older site, but it still has great info on the various terms.

OK, so how do I add it?

You can grab the latest version and instructions over on my GitHub: https://github.com/MisterPhilip/webstorm-turbine-dummy

Additionally, you can learn more about how to install the dummy file in WebStorm by watching the tutorial below:

Other IDEs that have code completion should have similar ways to install a third party library. Worst case, you can always add the file to your project in the root or source directory, and then exclude it via a .gitignore rule.

Hopefully this makes it slightly easier for other developers to build their Adobe Launch extensions. Have feedback or want to contribute? I'd love to hear it! Tweet me at @_MisterPhilip, or submit an issue/pull request in the GitHub repository.

Author

Philip

Director, Analytics Innovations at Acronym, Omnibug.io Developer, Cyclist, Photographer

View Comments
Next Post

Lessons From Building an Adobe Launch Extension