Skip to content

Latest commit

 

History

History
 
 

vscode-ui5-language-assistant

UI5 Language Support

This VS Code extension provides SAPUI5 language editor support.

Features

XML Views Auto-Complete/Context-Assist

Description

The tool provides the following support:

  • Relevant filters to suggestions. For example:

    • Only classes that match the parent aggregation's type are offered.
    • In a "full" aggregation with cardinality 0..1, no more suggestions are made.
    • Only classes inside the xmlns prefix used are offered.
    • Deprecated and experimental SAPUI5 nodes are not be offered by default (configurable).
  • Additional text for ease of use. For example:

    • Auto-insertion of name for closing tags for classes and aggregations.
    • Auto-insertion of ="" for attribute key suggestions.
    • Auto-insertion of the xmlns prefix for classes and aggregation tags.
  • Tooltips displayed while browsing the suggestions including a clickable link to the SAPUI5 SDK (Demo Kit).

Availability

The feature is available in the following:

  • XML tags:

    • Classes
    • Aggregations
  • XML attribute keys:

    • Properties
    • Events
    • Associations
    • Namespace prefixes
  • XML attribute values:

    • Enum values
    • Boolean values
    • Namespaces fully qualified names

XML View Validations

Description

The list of validations and their severity are currently hard-coded and cannot be configured by the end user.

Validation List

  • Errors:

    • Invalid boolean values
    • Unknown attribute keys
    • Unknown eum values
    • Unknown xmlns namespace
    • Unknown tag names
    • Duplicate ID tags
    • Wrong cardinality of aggregation
    • Wrong type of tags inside aggregations
    • Missing or empty ID when flexEnabled is true (stableID)
  • Warnings:

    • Use of deprecated classes
    • Use of deprecated aggregations
    • Use of deprecated properties
    • Use of deprecated events
    • Use of deprecated associations

XML View Quick Fix

Description

Quick Fix will be shown for some validations when hovering over a diagnostic or from the problems view.

Quick Fixes List

  • Missing or empty ID when flexEnabled is true (stableID).
    • Will add a generated ID.
    • Supports both fixing a single missing ID or all missing IDs in an entire file.

XML View Hover Tooltips

Description

Tooltips will be shown when hovering over an item.

Availability

The feature is available in the following:

  • XML tags:

    • Classes
    • Aggregations
  • XML attribute keys:

    • Properties
    • Events
    • Associations
    • Aggregations
  • XML attribute values:

    • Enum values
    • SAPUI5 Namespaces

manifest.json Auto-Complete and Validations

Description:

Implemented using the UI5 manifest.json schema.

Installation

From the VS Code Marketplace

In the UI5 Language Assistant VS Code marketplace page, click Install.

From GitHub Releases

  1. Go to GitHub Releases.
  2. Search for the .vsix archive under ui5-language-assist\@x.y.z releases. (Replace x.y.z with the desired version number.)
  3. Follow the instructions for installing an extension from a .vsix file in the VSCode's guide.

Usage

This extension's features are automatically enabled when opening/editing relevant SAPUI5 source files. For SAPUI5 XML views, this means:*.view.xml or *.fragment.xml files.

Note that the extension lazily downloads the SAPUI5 metadata needed for its features. This means that there may be a delay between starting VS Code and having the relevant features available.

Limitations

SAPUI5 version

This extension currently uses a hard-coded (1.71.x) version for the SAPUI5 metadata.

Custom controls

This extension does not currently support custom controls, some features, such as validations, may use heuristics to guess that a tag is a custom control. However, no auto-complete is currently offered for custom controls.

Support

You can open issues on GitHub.

Contributing

See CONTRIBUTING.md.