Git Product home page Git Product logo

ui5-language-assistant's Introduction

CircleCI Coverage Status Language grade: JavaScript styled with prettier Commitizen friendly DependentBot REUSE status

UI5 Language Assistant

This npm mono-repo contains editor related tooling for SAPUI5 and OpenUI5 projects.

It currently contains:

Support

Please open issues on github.

Contributing

See CONTRIBUTING.md.

Licensing

Copyright 2023 SAP SE. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.

ui5-language-assistant's People

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  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  avatar  avatar  avatar  avatar  avatar  avatar

ui5-language-assistant's Issues

Remove manifest.json schema in this repo.

Link to the SchemaStore reference.

Questions and Concerns:

Memory Benchmark

The UI5 language server downloads a large amount of UI5 SDK data and retain it in memory.

It would be interesting to discover how much memory exactly is needed to run the UI5 Lang Server.
It would also be interesting to monitor regressions and memory consumption overtime.

Update Hard-Coded UI5 version

Add warning if property contains the default value

Hello, I have a feature request for you:

I sometimes find myself copying source code from the samples page. These examples are sometimes "bloated" (e.g. SimpleForm). Or I just try different values for a specific property and then stick with the default value because I like it the most (e.g. different backgroundDesigns for a Panel.

It would be nice to know that I can just remove the property because it contains the default value.

Topic Links in api.json are not correctly translated into valid URLs

When getting information on the table tag in a view xml the mentioned link

https://sapui5.hana.ondemand.com/1.71.14/#/api/topic:5eb6f63e0cc547d0bdc934d3652fdc9b[](https://github.wdf.sap.corp/storage/user/15976/files/1d275680-8f6c-11ec-9fea-e8f59b02e738)

does not exist.

image

Steps to Reproduce
Steps to reproduce the behavior:

Go to view.xml file
show context information for table
Click on 'hyperlink'
See error 'The requested resource was not found'
Screenshots
image

Version/Components/Environment
Fiori tools Version of extensions in this release: 1.4.7

best regards
Eckard.

UI5Aggregation.type may be too wide

It is currently defined using the general "UI5Type" type union.

Relevant Discussion:

@codeworrior said:

The “type“ property should be restricted to UI5Class | UI5Interface, that’s what the runtime expects
The “altTypes” array is not really validated / restricted in the runtime implementation, but it was originally intended to be limited to primitive types and maybe enums (as they are a kind of primitive)

Investigate edge cases of Aggregations used as an attribute

Should an aggregation without AltTypes:

  • Raise an issue when used as an attribute? should it be unknown attribute error?
  • if deprecated raise a deprecated warning when using as an attribute?
  • Can there be namespace conflicts between aggregations/props/events/assosiations?
    • Is this possible namespace conflict depend on the altTypes prop?
    • TODO: examine api.json are all members in a single dictionary thus prevent the conflict?

Better support for links in documentation

Some link text is not correctly rendered as links to the SAP UI5 documentation.
Examples:

  • Documentation links: topic:5ee619fc1370463ea674ee04b65ed83b should be rendered as https://sapui5.hana.ondemand.com/<version>/topic/5ee619fc1370463ea674ee04b65ed83b
  • Method names: #attachValidateFieldGroup should be rendered as https://sapui5.hana.ondemand.com/<version>/api/sap.ui.core.Control#methods/attachValidateFieldGroup
    • The logic for this should be to first check if the text is the name of a method, property, aggregation or event in the current context object (or its parents through inheritance) and create the link to the correct section accordingly. Note that only methods have direct links, the rest of the types can be linked to the corresponding section.
      Since we will need the context object for this check, we will have to send it to the documentation function.

Publish to Open VSX

Since this repo is already open source, it would be nice if this extension could be also published to Open VSX.
This would benefit other IDEs such as SAP BAS or Gitpod since they are based on Eclipse Theia which can handle extensions officially only from the Open VSX registry.

getUI5NodeFromXMLElementNamespace utility may return a too wide "namespace" type

The namespace property returned is a BaseUI5Node, Should it be a plain UI5Namespace instead?

  • /**
    * Return the UI5 Namespace from the specified or default XML Element namespace
    *
    * @param xmlElement
    * @param model
    */
    export function getUI5NodeFromXMLElementNamespace(
    xmlElement: XMLElement,
    model: UI5SemanticModel
    ): {
    namespace: BaseUI5Node | undefined;
    isDefault: boolean;
    isXmlnsDefined: boolean;
    };

This is due to some possible edge cases that existed or may exist in the UI5 SDK.

  • Some namespaces were mistakenly defined as an enum.
  • In theory a UI5 Class may appear as a member of another UI5 Class (although no relevant instance is known).

Such a change may affect the behavior of some features, for example:

  • Unknown namespace error in XMLView, how to treat a completely unknown namespace (foo.bar.x) versus a partially known but invalid namespace (sap.ui.core.x).

Relevant draft PR:

UI5 version is outdated

Hello,

UI5 Language assistant use an hardcoded UI5 library 1.71.14 and this version is outdated and removed from SAP CDN

example: https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/chart/designtime/api.json
2022-08-31_15-21-57

I work with Business Application Studio, so files are cache in this repo /home/user/.theia/globalStorage/saposs.vscode-ui5-language-assistant. But for new library I have the message:
Unknown namespace: "sap.ui.core.mvc"UI5 Language Assistant

Cause from output console with trace activated:

{
  "label": "@ui5-language-assistant/language-server",
  "level": "error",
  "message": "Could not read UI5 resources from",
  "time": "2022-08-31T12:59:20.642Z",
  "url": "https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ui/fl/designtime/api.json"
}

Could you please change the UI5 version to a non outdated one ?

Thank you,

Nicolas Couret

Auto complete doesn't work with corporate proxy

Hi,

Excellent to see SAP taking ownership of these extensions. However the extension doesn't work through corporate proxy, even though it has been added in VS code settings and windows environment variables.

See output below

c:\Users\KjaerJ\AppData\Roaming\Code\User\globalStorage\saposs.vscode-ui5-language-assistant\ui5-resources-cache\1.71.14 will be used to cache UI5 resources
[Error - 9:46:22 am] Request textDocument/hover failed.
Message: Request textDocument/hover failed with message: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
Code: -32603
(node:13616) UnhandledPromiseRejectionWarning: FetchError: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
at ClientRequest. (c:\Users\KjaerJ.vscode\extensions\saposs.vscode-ui5-language-assistant-1.5.1\node_modules@ui5-language-assistant\language-server\dist\server.js:48289:11)
at ClientRequest.emit (events.js:203:13)
at TLSSocket.socketErrorListener (_http_client.js:399:9)
at TLSSocket.emit (events.js:203:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:13616) UnhandledPromiseRejectionWarning: FetchError: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
at ClientRequest. (c:\Users\KjaerJ.vscode\extensions\saposs.vscode-ui5-language-assistant-1.5.1\node_modules@ui5-language-assistant\language-server\dist\server.js:48289:11)
at ClientRequest.emit (events.js:203:13)
at TLSSocket.socketErrorListener (_http_client.js:399:9)
at TLSSocket.emit (events.js:203:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:13616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13616) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:13616) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:13616) UnhandledPromiseRejectionWarning: FetchError: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
at ClientRequest. (c:\Users\KjaerJ.vscode\extensions\saposs.vscode-ui5-language-assistant-1.5.1\node_modules@ui5-language-assistant\language-server\dist\server.js:48289:11)
at ClientRequest.emit (events.js:203:13)
at TLSSocket.socketErrorListener (_http_client.js:399:9)
at TLSSocket.emit (events.js:203:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:13616) UnhandledPromiseRejectionWarning: FetchError: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
at ClientRequest. (c:\Users\KjaerJ.vscode\extensions\saposs.vscode-ui5-language-assistant-1.5.1\node_modules@ui5-language-assistant\language-server\dist\server.js:48289:11)
at ClientRequest.emit (events.js:203:13)
at TLSSocket.socketErrorListener (_http_client.js:399:9)
at TLSSocket.emit (events.js:203:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:13616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:13616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
[Error - 9:46:31 am] Request textDocument/hover failed.
Message: Request textDocument/hover failed with message: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
Code: -32603
[Error - 9:46:32 am] Request textDocument/completion failed.
Message: Request textDocument/completion failed with message: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
Code: -32603
(node:13616) UnhandledPromiseRejectionWarning: FetchError: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
at ClientRequest. (c:\Users\KjaerJ.vscode\extensions\saposs.vscode-ui5-language-assistant-1.5.1\node_modules@ui5-language-assistant\language-server\dist\server.js:48289:11)
at ClientRequest.emit (events.js:203:13)
at TLSSocket.socketErrorListener (_http_client.js:399:9)
at TLSSocket.emit (events.js:203:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:13616) UnhandledPromiseRejectionWarning: FetchError: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
at ClientRequest. (c:\Users\KjaerJ.vscode\extensions\saposs.vscode-ui5-language-assistant-1.5.1\node_modules@ui5-language-assistant\language-server\dist\server.js:48289:11)
at ClientRequest.emit (events.js:203:13)
at TLSSocket.socketErrorListener (_http_client.js:399:9)
at TLSSocket.emit (events.js:203:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:13616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:13616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
[Error - 9:48:13 am] Request textDocument/hover failed.
Message: Request textDocument/hover failed with message: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
Code: -32603
(node:13616) UnhandledPromiseRejectionWarning: FetchError: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
at ClientRequest. (c:\Users\KjaerJ.vscode\extensions\saposs.vscode-ui5-language-assistant-1.5.1\node_modules@ui5-language-assistant\language-server\dist\server.js:48289:11)
at ClientRequest.emit (events.js:203:13)
at TLSSocket.socketErrorListener (_http_client.js:399:9)
at TLSSocket.emit (events.js:203:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:13616) UnhandledPromiseRejectionWarning: FetchError: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
at ClientRequest. (c:\Users\KjaerJ.vscode\extensions\saposs.vscode-ui5-language-assistant-1.5.1\node_modules@ui5-language-assistant\language-server\dist\server.js:48289:11)
at ClientRequest.emit (events.js:203:13)
at TLSSocket.socketErrorListener (_http_client.js:399:9)
at TLSSocket.emit (events.js:203:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:13616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
(node:13616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
(node:13616) UnhandledPromiseRejectionWarning: FetchError: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
at ClientRequest. (c:\Users\KjaerJ.vscode\extensions\saposs.vscode-ui5-language-assistant-1.5.1\node_modules@ui5-language-assistant\language-server\dist\server.js:48289:11)
at ClientRequest.emit (events.js:203:13)
at TLSSocket.socketErrorListener (_http_client.js:399:9)
at TLSSocket.emit (events.js:203:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:13616) UnhandledPromiseRejectionWarning: FetchError: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
at ClientRequest. (c:\Users\KjaerJ.vscode\extensions\saposs.vscode-ui5-language-assistant-1.5.1\node_modules@ui5-language-assistant\language-server\dist\server.js:48289:11)
at ClientRequest.emit (events.js:203:13)
at TLSSocket.socketErrorListener (_http_client.js:399:9)
at TLSSocket.emit (events.js:203:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:13616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 5)
(node:13616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 5)
[Error - 9:48:13 am] Request textDocument/completion failed.
Message: Request textDocument/completion failed with message: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
Code: -32603
(node:13616) UnhandledPromiseRejectionWarning: FetchError: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
at ClientRequest. (c:\Users\KjaerJ.vscode\extensions\saposs.vscode-ui5-language-assistant-1.5.1\node_modules@ui5-language-assistant\language-server\dist\server.js:48289:11)
at ClientRequest.emit (events.js:203:13)
at TLSSocket.socketErrorListener (_http_client.js:399:9)
at TLSSocket.emit (events.js:203:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:13616) UnhandledPromiseRejectionWarning: FetchError: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/scfld/md/designtime/api.json failed, reason: connect ETIMEDOUT 23.48.30.95:443
at ClientRequest. (c:\Users\KjaerJ.vscode\extensions\saposs.vscode-ui5-language-assistant-1.5.1\node_modules@ui5-language-assistant\language-server\dist\server.js:48289:11)
at ClientRequest.emit (events.js:203:13)
at TLSSocket.socketErrorListener (_http_client.js:399:9)
at TLSSocket.emit (events.js:203:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:13616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)
(node:13616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)

Fragment inside aggregation "incorrectly" marked as error

Technically this is not a bug per se -- hence "incorrectly" in the title between quotes -- however the behavior described below does seem incorrect either way

Version: 1.5.1

Imagine the following simplified XML page:

<Page>
    <content>
        <core:Fragment fragmentName="Fragment1" type="XML" />
        <core:Fragment fragmentName="Fragment2" type="XML" />
    </content>
</Page>

The ui5-language-assistant marks both fragment lines as:

The class "Fragment" is under the aggregation "content" and must match the type "Control"

While this is technically correct, the Fragment "may contain" a valid control.

(Yes, it may also contain a potential invalid control, but I understand the difficulty of parsing the contents inside the core:FragmentDefinition tag of the fragment. However, I feel the chance of using an incorrect class inside the fragment is far lower than marking every core:Fragment class inside an aggregation as being incorrect)

Performance Benchmarks

In most flows it is the perceived human performance that counts, so things that take < 100ms are virtually instantaneous.

The question if there are some flows that may become slow enough that a human would notice, e.g:

  • Certain validations in 10,000 lines large xml view.
  • Auto-Complete suggestions in a very large xml view
  • Time for downloading and transforming UI5 SDK -> Semantic Model.

False error raised about sap.m.Avatar

Issue
The UI5 Language Assistant raises the following false alert:

The "Avatar" name is neither a class name in the "sap.m" namespace nor an aggregation of the "sap.m.FlexBox" class

Envirement

Version
SAPUI5 1.79.1
UI5 Language Assistant 1.2.0

Button type "Success" not known

The button type "Success" is not known to the language assistant and therefore marks the type as an error. The type needs to be added.

image

Evaluate using lerna "Fixed/Locked" mode.

We are current using Lerna Independent mode.

However this causes some issues:

  • BREAKING CHANGES commits may touch multiple packages, resulting is less clear CHANGELOG.
  • Managing multiple versions can be confusing, e.g < 1.0.0 versions behave differently on major bumps versus > 1.0.0 versions.
  • All the packages here go into a single product (VSCode Ext), But with multiple changelogs its difficult to understand what actually changed in the VSCode Ext...

Perhaps we should use Fixed/Locked mode in lerna with a single centralized changelog for all packages?

Support Multiple SAPUI5 versions

Downloading the UI5 metadata

Configurability

  • By default configure UI5 metadata version based on ui5.yaml.
  • Optional override: Configure UI5 metadata version via a VSCode Settings.
  • Fallback to some hard-coded recently released version.

Test Flows

  • Decide to set of versions to be tested.
  • For a set of supported UI5 versions, transform the metadata to UI5SemanticModel.
  • Run all language-server E2E tests using a set of supported versions.
    - Question: How to achieve high code reuse while also allowing different assertions (per version) for some test cases?

Open Questions

  • Are different typeNameFixes needed for different libraries or could a superset of all be used?
    • function getTypeNameFix(): TypeNameFix {
      const fixes: TypeNameFix = {
      Control: "sap.ui.core.Control",
      Element: "sap.ui.core.Element",
      array: "object[]",
      Array: "object[]",
      bloolean: "boolean",
      "sap.m.PlanningCalendarHeader": undefined,
      "sap.m.TimePickerSlider": undefined,
      "sap.ui.layout.ResponsiveSplitterPage": undefined,
      "sap.gantt.misc.AxisTime": "sap.gantt.misc.AxisTimes",
      "sap.gantt.control.Toolbar": undefined,
      "sap.gantt.DragOrientation": undefined,
      "sap.gantt.simple.GanttHeader": undefined,
      "sap.gantt.simple.InnerGanttChart": undefined,
      "sap.rules.ui.RuleBase": undefined,
      "sap.ui.generic.app.transaction.BaseController": undefined,
      "sap.ui.vk.BillboardTextEncoding": undefined,
      "sap.ui.vk.BillboardStyle": undefined,
      "sap.ui.vk.BillboardBorderLineStyle": undefined,
      "sap.ui.vk.BillboardHorizontalAlignment": undefined,
      "sap.ui.vk.BillboardCoordinateSpace": undefined,
      "sap.ui.vk.DetailViewType": undefined,
      "sap.ui.vk.DetailViewShape": undefined,
      "sap.ui.vk.tools.HitTestIdMode": undefined,
      "sap.ui.vk.tools.CoordinateSystem": undefined,
      "sap.ui.vk.AnimationTimeSlider": undefined,
      "sap.ui.vk.SelectionMode": undefined,
      "sap.ui.vk.RenderMode": undefined,
      "sap.viz.ui5.controls.VizRangeSlider": undefined,
      };
      return fixes;
      }
  • Does the current implementation of the metadata caching in the language-server support versioning?

Switch to Lerna "Fixed/Locked" Release mode

Context

This mono-repo is currently using Lerna's "Independent" mode

This means each sub-package version/life-cycle is managed individually.

While it sounds better in theory, it actually adds too much complexity:

Independent mode is particularly useful for two cases:

  1. When different subsets of sub-packages are consumed by different users as libraries.

    • Which is not the case as the main artifact of this repo is the VSCode extension not the sub-package libraries.
      in other words: This is a mono-repo for a VSCode Extension made up of Multiple modules (not libraries).
    • It may even be possible to make all the packages in this repo private...
  2. When a TypeScript types package is exported.
    Which does happen in this mono-repo, but due to (1) above it is not targeted at external consumption.

Open Questions:

  • Which version should be used for new releases?
    • max(map(sub-packages.version)) + 1.0.0 ? (Answer: 3.0.0)
  • Can an aggregated ChangeLog be re-generated from historic SCM data? (Answer: No).
  • Would the VSCode ext package still contain a CHANGELOG.md? (Answer; Yes)
    • If not should the root CHANGELOG.md be copied to it during VSIX bundling?

Strange autocomplete behavior when using the default namespace

The autocomplete works fine in the manifest file and when I use “named” namespaces. The only thing that doesn’t seem to work is when I want to use tags from the default namespace (like xmlns=”sap.m”). In this case, autocomplete is not working.

After playing around for a while, I noticed that it "works" when I open a "nested tag" (see GIF). This might be related to my VS Code settings.

2020-07-09_10-29-03-1

manifest.json cannot be analyzed in TypeScript projects

I was playing around with the new Typescript environment:

https://github.com/SAP-samples/ui5-typescript-helloworld

I noticed that the manifest wasn't analyzed by the language assistant. No auto complete, no warnings/errors.

I guess this is because in Typescript the source code will be placed in /src and not /webapp (/webapp is where the transpiled JavaScript is put when the npm task watch:ts).

I would love to use the language assistant in Typescript projects as well, please consider implementing this.

VSCODE / BAS Feature requests that would really help

Hi Colleagues,

Working for years with UI5 XML Views in the Fiori Elements library I would like to share my ideas about what would really be helpful in a UI5 XMLView assistant.

Navigation / go to definition (most helpful)

  1. In general: Any of the targets (js code, fragments) may be in the local repository (app as well
    as library repo), in a different cloned repository on the local machine, or is only in the "remote"
    ui5 distribution. It would be very helpful that the navigation would always try to find a local
    version and if not available locally go to the sapui5 documentation instead.

  2. Fragments. Ctrl/Cmd Click on a fragmentName reference should open the fragment in the
    editor.
    <core:Fragment fragmentName="sap.fe.templates.ObjectPage.view.fragments.HeaderImage" type="XML" />

  3. template:require / core:require should open the corresponding file if locally available or the
    sapui5 documentation if not.

template:require="{
	macroLibrary: 'sap/fe/macros/macroLibrary',
	CORE: 'sap/fe/core/AnnotationHelper',
	MODEL: 'sap/ui/model/odata/v4/AnnotationHelper',
	ID: 'sap/fe/core/helpers/StableIdHelper'
}"
core:require="{FilterBarRuntime: 'sap/fe/macros/FilterBarRuntime'}"
  1. Navigate to controller (if it function starts with .) or static function defined by
    template:require / core:require.
    E.g. idPrefix="{= ID.generate([${this>id}, 'FilterFieldValueHelp']) }" should allow navigation
    to the function definition of generate() in sap/fe/core/helpers/StableIdHelper.js as defined
    in the template:require above. This should work no matter if it is about formatter, expression
    binding or event handler.

Type ahead / suggest (awesome)

It would be very helpful if auto suggest would work when typing all of the navigation examples.

1.<core:Fragment fragmentName=" would give a list of locally available fragments
2. template:require: ' would give a list of classes defined locally or in ui5. Ideally path segment
wise (first suggest of sap/, then sap/{second segement} and so on
3. For event handlers, formatters and expression binding: Starting with the . would suggest
functions from the controller. If it starts with a word defined in template:require or
core:require it would suggest functions from that javascript file.

Syntax validation

A minimal syntax check for the following notations would help

  1. UI5 Binding for properties, aggregations or context binding, e.g.
    {path: 'entitySet>$Type', formatter: 'FIELD.getBindingForDraftAdminBlockInline'}
  2. UI5 Expression Binding visible="{= !${IsActiveEntity} || ${HasDraftEntity}}"

In the example 1. above, in case FIELD is not defined in either template:require or core:require` it should be marked as an error.

Parenthesis / Brackets / Curly Braces highlighting for

  1. UI5 Binding
  2. UI5 Expression Bindings

Thanks,
Thorsten

Move generic XML utils from @ui5-Lang-Assistant/logic-utils to XML-Tools/common

Some of the utilities in the logic-utils package are not specific to UI5 flows or structures.
These should be part of @xml-tools/common to avoid future duplication / re-implementation.

e.g:

  • export function xmlToFQN(astElement: XMLElement): string;
  • export function xmlClosingTagToFQN(astElement: XMLElement): string;
  • export function splitQNameByNamespace( qName: string ): { prefix: string | undefined; localName: string };
  • ...

Support more html tags in documentation

Some missing tags/special cases are:

<p>
<ol> - use 1. for ordered list items
<a href=...> - make a link for http(s), remove link for others
<a>, <a name ...> - should be removed
<table>, <tr>, <td>, <th>, <tt>
<u>
<B>, <Li>, <br >, <table border="1"> - we should probably ignore the case, white space and additional properties in all tags
<caption>
<svg> - we should probably remove it and add a note that says the image can be viewed in the "More Information" link

Additionally we should add a test that checks all tags are covered in the versions we support (with a whitelist for tags we shouldn't support even though they appear in the documentation, because they are not really tags - <int>, <Note:> etc)

Hover runtime error on unknown property

When hovering on attributes of XML prolog, or when renaming a known tag to an unknown tag
and error: is thrown:

(node:6752) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '::DEFAULT' of undefined

XML code completion does not work

Hello,

when I try to execute code completion on a xml-view in my ui5 project, the code completion does not work as expected.
I can see suggestions for tags and properties that I have already used in my view, but no other suggestions.

In my terminal I can find an error, when the language assistant tries to fetch data from https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ui/core/designtime/api.json".

image

If I try to access the url in my browser, the page says the version was remove because it's deprecated.

TS Compilation issues

Hello,
I'm trying to help a bit with the proxy issues. However I get a fair few typescript compilation errors on the text edit range.
packages/language-server/test/completion-items-utils.ts:120:45 - error TS2339: Property 'range' does not exist on type 'TextEdit | InsertReplaceEdit'.
Property 'range' does not exist on type 'InsertReplaceEdit'.

The UI5 Language Assistant server crashed 'SELF_SIGNED_CERT_IN_CHAIN'

I encountered an issue running the UI5 language assistant behind our corporate proxy. The proxy settings themselves do not seem to be a problem but I'm getting a self signed certificate error.

Below you'll find the error message:

[Error - 08:59:05] Request textDocument/codeAction failed.
  Message: Request textDocument/codeAction failed with message: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/ui/designtime/api.json failed, reason: self signed certificate in certificate chain
  Code: -32603 

c:\Users\ak\.vscode\extensions\saposs.vscode-ui5-language-assistant-1.7.2\node_modules\@ui5-language-assistant\language-server\dist\server.js:60822
			reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
			       ^
FetchError: request to https://sapui5.hana.ondemand.com/1.71.14/test-resources/sap/ca/ui/designtime/api.json failed, reason: self signed certificate in certificate chain
    at ClientRequest.<anonymous> (c:\Users\ak\.vscode\extensions\saposs.vscode-ui5-language-assistant-1.7.2\node_modules\@ui5-language-assistant\language-server\dist\server.js:60822:11)
    at ClientRequest.emit (node:events:390:28)
    at TLSSocket.socketErrorListener (node:_http_client:447:9)
    at TLSSocket.emit (node:events:390:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  type: 'system',
  errno: 'SELF_SIGNED_CERT_IN_CHAIN',
  code: 'SELF_SIGNED_CERT_IN_CHAIN'
}
[Error - 08:59:05] Connection to server got closed. Server will not be restarted.

Hard-Coded UI5 Version (known limitation)

the hard-coded UI5 Version (listed in known limitations of the VSCode Extension)

could we have a preference setting, where we could set the version that is to be used?

something like

UI5LanguageAssistant.codeAssist.ui5version = "1.84.4"

maybe along with "sapui5/openui5" switch

Distinguish between SAPUI5 and OpenUI5 projects

Introduction

SAPUI5 and OpenUI5 have a different set of libraries available, but currently
the UI5 language server always creates the underlying data model using the SAPUI5 set of libraries.
This means that completions and validations are done against a possibly incorrect model, e.g:

  • Suggestions offered from libraries that are not available.
  • Not validation when using a Class tag that is not available in OpenUI5.

Open Questions

  • How does a UI5 project determine if its an OpenUI5 or SAPUI5 project?
  • Is it perhaps a different question of the general set of "imported" libraries? rather then just two options (A vs B).

Autocomplete in manifest.json files

Hello,

Autocompletion in manifest.json is very useful, thank you for that!
However there are cases when the file has other name. In this case the file is not detected as being a manifest, so the feature doesn't work.
Take for example "myCardWithTranslations.json". I can rename it to "myCardWithTranslations.manifest.json", but it still won't be detected. It would be useful to check if the file name ends on manifest.json, so you can match all "*.manifest.json" files.

The best solution I see is to detect usage of the $schema keyword (https://json-schema.org/understanding-json-schema/reference/schema.html) and see if this piece of JSON is using the expected schema, but this would require also a change in the app descriptor.

Best regards,
Petar

E2E VSCode tests are skipped/disabled

There seems to be multiple issues involved.

  1. These tests are consistently failing.
    • Checked on both windows/mac local dev machines.
  2. On CircleCI starting VSCode during seems to fail on the 2nd+ suite.

This root cause does not seem to be related to this repo's source code
As there are no failing builds merged to master, nor does checking-out the previous release tag resolve the issue.

There are two factors that may be related.

  • The tests run on the latest version of VSCode, so that may have changed.
  • The tests run on CircleCI docker images which are also updated automatically.

I am currently disabling some of these tests as I am unable to figure out what is the issue.

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.