Giter VIP home page Giter VIP logo

ui5-codecompletion's Introduction

UI5 codecompletion

Build Status npm Package

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.

coding example

Installation

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.

Usage

$~ > 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

download, install and configure UI5 LTS version

$~/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)

  • Open the "Settings > Languages & Frameworks > JavaScript > Libraries" dialog
  • Select "LocalUI5Library" and hit "Manage Scopes"
    activate local lib
  • Select/Add the directory of your project code completion should apply to via selecting "LocalUI5Library" in "Library" drop-down:
    assign lib

download a custom version to a custom location and install and configure it for code completion

$~/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)

configure existing UI5 lib for use with code completion

$~/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)

FAQ

Why openUI5 only and not SAPUI5 as well?

Because downloading SAPUI5 requires checking of a disclaimer in the UI and we were too lazy to script that. PR welcome!

Can I have multiple UI5 versions installed/configure in a project?

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.

Why WebStorm only?

That's the editor we're using. Feel free to port to yours. PR welcome!

Related

  • UI5 Schemas
    for code completion in XML views in WebStorm
  • UI5 helper
    for some comfort navigating inside sources of a UI5 app in WebStorm

Contributors


Constantin Lebrecht

ui5-codecompletion's People

Contributors

dependabot-support avatar rsletta avatar vobu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.