Getting errors for duplicate IDs across different view files
I'm now getting a highlighted error when using the same IDs across different view files. For instance, in the file ShopItemListReport.view.xml:
Select a unique ID. The current "dynamicPageId" ID has already been used. UI5 Language Assistant
ShopPackageListReport.view.xml(13, 12): An identical ID is also used here.
I have some generic controller classes that I reuse across similar views, and they depend on those views having controls with particular IDs, so this would break many of my implementations. This "error" wasn't being highlighted before, and I'm not exactly sure what caused it to be highlighted. I first noticed when updating my project's dependencies, but checking out an earlier branch hasn't prevented it from showing up again.
Is there a way to disable this check?
Someone else has come up with this issue recently and reported it here: iljapostnovs/VSCodeUI5Plugin#422
This may also be related to #646
Issue is gone after rolling back to version 4.0.66
Yes we are getting the same error with the new update, rolling back to version 4.0.66 solved it, but I wonder what is the reasoning behind this addition.
@patakihara Thanks for your feedback. This is a new feature added recently based on this enhancement request: https://github.com/SAP/ui5-language-assistant/issues/646 We can think if we would like to convert these error messages to warnings or handle them otherwise, but so far we consider that as a useful feature, as in many cases non-unique IDs in different files do brake the app in runtime
@MN-public
In my project this won't brake the app in runtime, and I require having the same IDs in different views to avoid duplicate code in my controllers.
Would it be possible to add a setting to disable this check, or at least make it a warning? Thank you!
@patakihara Thanks for explaining your use case. We will see what we can do.
I would also vote for the possibility to disabling this message. Also I see no use to make the control ids view dependent and producing an error when using this id in different views.
@patakihara we have provided user settings to limit diagnostic reporting on unique ids. You can download v4.0.75 and test it.Early feedback is highly appreciated. :)
User setting by default is not set, you can set it to limit diagnostic reporting. The settings looks like:
If this setting solves your issue, please close this issue. Thanks a lot.
@marufrasully it's working as intended! Thank you so much 😄
Sorry for the delay in closing the issue!