iljapostnovs / VSCodeUI5Plugin

Visual Studio Code Extension for UI5 Development
Apache License 2.0
61 stars 6 forks source link

Feature request: Support for javascript views and fragments #171

Open chtulhu-erebus opened 3 years ago

chtulhu-erebus commented 3 years ago

Hello,

is there any chance to support javascript views and fragments?

The UI5 Tool gives me an error when linting the path in a .js view and also the switch controller/view function is not working.

Regards

iljapostnovs commented 3 years ago

Hi,

Actually this is quite huge effort. SAP already didn't help with existence of ".controller.js" files. The problem is that it's hard to distinguish the class file path from class file name. E.g. you have class name "com.test.controller.MyController". It takes a lot of workarounds to check if it is ./src/controller/MyController.js or ./src/controller/MyController.controller.js. Same amount of workarounds is required for .view.js files and it will impact performance as well, because the only way to distinguish class file path from class name is to read file from hard drive. Taking in mind that js views are exceptionally rare, I didn't think to support them. If you could provide any simple example, I could take a look and think about how much work it requires to support switch between view/controller and adjust linters.

chtulhu-erebus commented 3 years ago

Hello, i've made a little app (with the help of the easy-ui5 generator) with a .js view and fragment. Hopefully its enough for inspecting.

com.test.zip