Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
maryana_naboka
Employee
Employee
SAPUI5 Language Assistant is now part of the SAP Fiori Tools extension pack for SAP Business Application Studio and Microsoft Visual Studio Code. It remains an open-source software and has several new features that can boost your productivity when developing SAP Fiori applications.

  1. LSP support for building blocks: allows for code completion and diagnostics for metaPath, contextPath and filterBar values.

  2. Offline work: allows for the use of a local web server to host the SAPUI5 SDK.

  3. Formatting capabilities: allows for splitting attributes on a new line.

  4. LSP for property binding info: provides suggestions for field names when configuring binding of a managed property.


What’s new in SAP UI5 Language Assistant


1. LSP support for building blocks


When developing Fiori applications with building blocks, you can use the following assisting features:



    • code completion for

      • metaPath values for all supported macros

      • contextPath values for Chart macro

      • filterBar values (from the current file)



    • diagnostics for

      • metaPath values

      • contextPath values

      • filterBar values (based on the filterBar IDs from the current file)






These features are based on the manifest settings of your app, namely "minUI5Version" and “entitySet” or “contextPath”.

Note: Code completion and validation is not available if “entitySet” or “contextPath” are defined dynamically in controllers.

To use the code completion, use CTRL+Space on Win or CMD+Space on Mac. Please note that if this shortcut is already used on your Mac for a different command, you can check and if needed re-define the shortcut in Settings->Keyboard Shortcuts of your IDE.


Keyboard shortcuts to trigger suggest on Mac OS


SAP UI5 language assistant knows which annotations are applicable for the macro and checks if they exist in your metadata or annotation files to offer you the suggestion and validate the existing values. 


2. Offline work


If you need to work offline when travelling or due to your company policy, you or your authorised administrator may download one or more supported versions of the SAPUI5 SDK for offline usage and then set up a local web server to host it.

You can use this web server implementation. as an example.Just follow the steps in the readme.md file to set it up.

Then all you need to do is register the local web server in the Visual Studio Code’s user/workspace setting "UI5LanguageAssistant.SAPUI5WebServer".


User/workspace setting for local web server


Now the UI5-related data used for code completion and diagnostics is taken from your local server as long as the hosted version matches the "minUI5Version" defined in manifest.json.

3. Formatting capabilities


You can now use the SAP UI5 language assistant extension also to format your *.view.xml and  *.fragment.xml files.



You can even decide, if you want the formatter to place each attribute on a new line. This is controlled by the new user/workspace setting UI5LanguageAssistant.SplitAttributesOnFormat.


User/workspace setting for formatting view and fragment files



4. LSP for property binding info


With this fresh feature, you can get suggestions for the field names when configuring binding of a managed property. The code completion makes sure the suggested values correspond to the specification in SAPUI5 API for property binding info.

Based on the same data, diagnostic errors are shown once the used names or grammar does not match the API for the given UI5 version.



Note: code completion and validation are only available for property and not for e.g. aggregations. 

These are just the recent updates. For more information on all the assistance features provided by the SAPUI5 language assistant extension please check the extension page in the VSC Marketplace or your IDE.