How to Get Code Completion of Flex ResourceBundle Names and Keys in IDEA
Learn how to autocomplete Flex resource bundles for Studio in IntelliJ IDEA.
What you'll learn
- Know how to get code completion for Flex resource bundles in Idea
Prerequisites
- Studio development experience
Time matters
Should I read this?
Only valid up to CoreMedia Content Cloud 10. |
During migration to Ext JS 6, we changed the property access syntax to the one used by Flex, because IDEA offers native support for that. However, Flex usually puts resource bundles into the top-level package, while CoreMedia Studio uses (quite lengthy) package names.
This unusual best practice seems to be untested in IDEA and thus naturally is buggy. Completion only seems to work when you start typing the whole package name (which of course is a bad drill-down, since all packages start the same: “com.coremedia…”).
But there is a trick to work around this IDEA bug: Start with an asterisk (*), and IDEA will show all resource bundles matching the given pattern! Also, all this only works if the second parameter, the property key, is already there, at least as an empty string.
For example, you write resourceManager.getString('\*BlueCom','')
, the important part is that you already have added the empty second parameter. Your cursor is inside the first parameter and you start autocompletion by pressing Ctrl+Space . IDEA will show all resource bundles starting with “BlueCom”. Select the one you need, and move the cursor into the empty second parameter. Auto complete again, and you will get all property keys to choose from.