UI5 code completion in *.js files for WebStorm
Of course there’s the WebIDE that provides helpful code completion features when editing UI5 controllers (*.js
) or views (*.xml
).
Then there’s WebStorm, the IDE of choice for many developers – for various reasons: from support of a large tooling ecosystem up to killer editing features (ctrl+G
!). But WebStorm is unfortunately (still) lacking native UI5 support…so, community to the rescue!
- Mark Schmale has written https://plugins.jetbrains.com/plugin/9427-ui5-helper that helps with navigating within UI5 projects in WebStorm
- Christian Schuff has authored ui5-schemas, providing auto completion for editing XML views.
What’s missing? Right, UI5 code completion for Controllers/JS-files. Until today 🙂
Here you go: ui5-codecompletion, a node module helping to provide…well…code completion when editing UI5 *.js-files in WebStorm.
In essence, ui5-codecompletion downloads, extracts and plugs UI5 sources into WebStorm’s JavaScript Library Scope.
Quick How-To:
- Install the npm module:
npm install -g ui5-codecompletion
- navigate to your UI5 project root dir in a shell:
cd ~/your/UI5/project
- in the shell, fire away:
ui5-codecompletion install
- (watch & wait)
- do the one-time WebStorm config as described in https://github.com/vobujs/ui5-codecompletion#download-install-and-configure-ui5-lts-version
- Open up
$some.controller.js
and enjoyctrl+Space
UI5 code completion
Now go code faster as never before 🙂
PS: ui5-codecompletion is under the WTFPL, so feel free to port/use however you want.
This is great!
I haven't tried your solution yet, but together with Christian Schuff's solution it seems my 3 year old (!) blog on how to manually configure JS and XML SAPUI5 code-completion in WebStorm can comfortably go to sleep now 😉
I gotta say, Robin's solution still the best and simplest one...
Why would I add another global npm plugin + manual steps if I can do the same with just a couple of manual steps?
For me it was simply having to work on different projects with different UI5 versions, including switching to different versions during development; all of that combined with offline capable development on the road. Was just easier for me to do this with a quick shell command instead of adjusting WebStorm config. But hey, to each his own, whatever works best for you.
Hi. i try run ui5-codecompletion install but i have de message "Runtime nodejs6 is no longer available. Please redeploy your function to a newer version.
is not pointing to a .zip file...exiting".
the npm module "ui5-codecompletion" is (as the npm page suggests) deprecated ever since UI5 release typescript types > 2 years ago. sorry 🙁