DEPRECATED: UI5 now delivers TS-types that allows a more complete code completion at dev time: https://github.com/SAP/ui5-typescript/tree/master/packages/ts-typesnode (was: CLI for adding UI5 code completion to WebStorm)
ui5-codecompletion
is a npm module providing a CLI that enables code completion in WebStorm's JS editor for a
specific version of (open)UI5.
npm install -g ui5-codecompletion
Yes, global install is recommended so you can install/configure code completion in any project.
Still, local install npm install ui5-codecompletion
will of course provide you node_modules/.bin/ui5-codecompletion
.
$~ > ui5-codecompletion -h
Usage: ui5-codecompletion <command> [options]
Commands:
configure [sourceDir] uses the extracted UI5 library in $project/
install [from] [to] downloads (if URL) or copies (if fs path) and
configures a UI5 runtime library for code completion
Options:
-h, --help Show help [boolean]
-f, --from URL or file system path to zip-file w/ UI5 runtime sources,
defaults to latest OpenUI5 version available
-t, --to file system path, relative to $project_dir, to store UI5
sources in; defaults to "$project/.ui5"
-s, --sourceDir file system path, relative to $project_dir, to configure code
completion with; defaults to "$project/.ui5"
Examples:
ui5-codecompletion install downloads and configures UI5 with
default options
ui5-codecompletion install installs UI5 from the specified URL
--from=https://url/openui5-runtime.zip to $project/.ui5
ui5-codecompletion install \ installs UI5 from the URL pointing
> -f=https://url/openui5-runtime.zip \ to the .zip, to
> -t=ui5/sources/local $project/ui5/sources/local
ui5-codecompletion configure uses UI5 sources in
$project/.ui5 to configure code
completion
ui5-codecompletion configure uses UI5 sources in
--sourceDir=my/relative/dir/ui5 $project/my/relative/dir/ui5 to
configure code completion
ui5-codecompletion configure -s=dir/ui5 uses UI5 sources in
$project_dir/dir/ui5 to configure
code completion
$~/your/app> ui5-codecompletion install
for downloading the most recent long term support runtime version of UI5,
storing it in .ui5
of your project and
preparing those sources for code completion.
(other options available, see above)
Then, tell WebStorm to use the library in your project. (this configuration is necessary, but only once)
$~/your/app> ui5-codecompletion install --from=https://example.org/ui5.zip --to=local/lib
for downloading your custom UI5 version to ~/your/app/local/lib
and use these sources for code completion.
(see above one-time config instructions if running ui5-codecompletion
for the first time)
$~/your/other/app> ui5-codecompletion configure --sourcedir=extracted/UI5/sources
will look for a resources
folder in ~/your/other/app/extracted/UI5/sources
and use
all *.dbg.js
UI5 files in there for code completion.
(see above one-time config instructions if running ui5-codecompletion
for the first time)
Because downloading SAPUI5 requires checking of a disclaimer in the UI and we were too lazy to script that. PR welcome!
Theoretically yes. Practically no, as it's not implemented - a single XML file is fed to WebStorm's scoping mechanism,
so only the most current UI5 library provided via ui5-codecompletion install -f=$url/ui5.zip
or
ui5-codecompletion configure -s=local/UI5/lib
is used for code completion.
That's the editor we're using. Feel free to port to yours. PR welcome!