iljapostnovs / VSCodeUI5Plugin

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

Bug: linting #351

Closed Jonas22rr closed 10 months ago

Jonas22rr commented 1 year ago

Hi,

First, I want to say that this is an awesome Extension. Good job!!!

So my Problem is…

When I open a normal xml-view there is a Problem with the linting. It shows errors over multiple attributes.

Linting Error

I have to bind my value like this, so normal there should be no error too. Error message

Expected behavior First, I’ve expected, that the error is only on one attribute. Second, there should be no error on my state-model (my state is an object in this case).

Screenshots image image

Desktop (please complete the following information):

Thank you!

Regards Jonas

iljapostnovs commented 1 year ago

Hi! Thanks for bug report. Could you please provide minimal project example in order to reproduce the issue?

Jonas22rr commented 1 year ago

Sorry for the late answer,

unfortunately, I cannot publish an example project.

Nevertheless, I can briefly describe when exactly the error occurs…

As soon as I get an error and it is displayed,

image

then delete the text again, the linting jumps to the new line

image

iljapostnovs commented 1 year ago

Hi,

Unfortunately I can't reproduce the issue with the steps you provided, everything works fine from my end.

So I will need either clear steps on how to reproduce it, or project minimal example. I will not be able to help if I can't reproduce the issue :)

I don't ask for full project example, it is clear that you can't provide me with real product code, but you can create a new project with minimal files with different naming etc., but which would have the problem you described.

Jonas22rr commented 1 year ago

if the linting is active on two attributes, and you change one in the name length, the error happens

image image

example code: `

<ToolbarSpacer /> <Button id="idOnAdd" icon="sap-icon://add" press="onAddRecipient" /> </OverflowToolbar> </headerToolbar> <columns> <Column> <Label text="{i18n>mailAddress}"></Label> </Column> <Column> <Label text="{i18n>name}"></Label> </Column> <Column> <Label text="{i18n>recipientStatus}"></Label> </Column> <Column importance="High" /> </columns> <dependents> <ColumnListItem id="idRecipientTemplate"> <Text text="{transport>mailAddress}" /> <Text text="{transport>name}" /> <Text text="{path: 'transport>recipientStatus', formatter: '.formatter.formatRecipientStatus'}" /> <FlexBox direction="RowReverse"> <Button icon="sap-icon://edit" id="idEditButton" press="onEditRecipient" class="sapUiSmallMarginEnd" type="Transparent" /> <Button icon="sap-icon://delete" id="idDeleteButton" press="onDeleteRecipient" class="sapUiSmallMarginEnd" type="Transparent" /> </FlexBox> </ColumnListItem> </dependents> </Table> <dependents> <TableSelectDialog id="idValueHelpRecipientsDialog" contentWidth="40rem" growingThreshold="100" confirm="onRecipientSelected" title="{18n>recipients}" search="onSearchRecipient" items="{transport>/RecipientSet}"> <columns> <Column> <header> <Text text="{i18n>mailAddress}"></Text> </header> </Column> <Column > <header> <Text text="{i18n>name}"></Text> </header> </Column> </columns> <ColumnListItem > <cells> <Text text="{transport>mailAddress}" class="sapUiSmallMarginTop sapUiSmallMarginBottom" /> <Text text="{transport>name}" /> </cells> </ColumnListItem> </TableSelectDialog> <Dialog id="idRecipientStatusDialog" title="{i18n>recipientStatus}"> <content> <form:SimpleForm > <Label text="{i18n>recipientStatus}"></Label> <Select selectedKey="{transport>recipientStatus}"> <items> <core:Item text="{i18n>to}" key=""></core:Item> <core:Item text="{i18n>cc}" key="C"></core:Item> <core:Item text="{i18n>bcc}" key="B"></core:Item> </items> </Select> </form:SimpleForm> </content> <beginButton> <Button id="idSaveButton" text="{= ${state>/createNewEntry} === true ? ${i18n>createRecipient} : ${i18n>updateRecipientStatus} }" type="Emphasized" press="onAccept" /> </beginButton> <endButton> <Button id="idCancelButtonas" text="{i18n>cancel}" type="Reject" press="onCancel" /> </endButton> </Dialog> </dependents> </ScrollContainer> <p></mvc:View>`</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/iljapostnovs"><img src="https://avatars.githubusercontent.com/u/31005247?v=4" />iljapostnovs</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p><img src="https://github.com/iljapostnovs/VSCodeUI5Plugin/assets/31005247/d0aaa5bd-3286-4ecd-b248-35b63493f975" alt="example" /> I have zero issues with this case. It's hard to tell why do you have it, tried it on MacOS, the result is the same.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Jonas22rr"><img src="https://avatars.githubusercontent.com/u/77532884?v=4" />Jonas22rr</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>can you send me your settings please? perhaps it is due to some setting</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/iljapostnovs"><img src="https://avatars.githubusercontent.com/u/31005247?v=4" />iljapostnovs</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <blockquote> <p>can you send me your settings please? perhaps it is due to some setting</p> </blockquote> <p>I tested it on a virtual machine without any kind of settings, clear installation.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Jonas22rr"><img src="https://avatars.githubusercontent.com/u/77532884?v=4" />Jonas22rr</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>I uninstalled the extension and started it from scratch. Unfortunately, the error came right back. I also had all my other extensions disabled, so I could rule out that there was an error due to another extension.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Jonas22rr"><img src="https://avatars.githubusercontent.com/u/77532884?v=4" />Jonas22rr</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>Here's an example Project, where the error occurs</p> <p><a href="https://github.com/iljapostnovs/VSCodeUI5Plugin/files/11950439/sssss.zip">sssss.zip</a></p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/iljapostnovs"><img src="https://avatars.githubusercontent.com/u/31005247?v=4" />iljapostnovs</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>I have opened the project and it works perfectly fine for me. So probably it is somehow OS related. It's the only thing left. I had troubles with Ubuntu VM, on my PC for some reason I had buggy software installation and I couldn't even install VSCode. I will try to install working ubuntu VM and pray that it's OS related issue, because otherwise I am out of ideas.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/iljapostnovs"><img src="https://avatars.githubusercontent.com/u/31005247?v=4" />iljapostnovs</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>I have installed fresh Ubuntu VM and everything works perfectly fine there as well, even faster than in Windows... Soooo, any ideas? Because I have none :(</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Jonas22rr"><img src="https://avatars.githubusercontent.com/u/77532884?v=4" />Jonas22rr</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>I have no Idea too :( </p> <p>I don't really know what here is happening XD / what is causing the problem <img src="https://github.com/iljapostnovs/VSCodeUI5Plugin/assets/77532884/c8971192-24ad-49e3-ba6e-25916d15d944" alt="image" /></p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/iljapostnovs"><img src="https://avatars.githubusercontent.com/u/31005247?v=4" />iljapostnovs</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>So, as I have absolutely no idea why do we have different behavior on the same OS, with absolutely clear VSCode install without any settings configured and using the same project, there are only two things which I think are at least theoretically possible: 1) You could download an extension source code, run it and debug it 2) Remote desktop connection</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/Jonas22rr"><img src="https://avatars.githubusercontent.com/u/77532884?v=4" />Jonas22rr</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>Yes, if I have a little time, I could debug it. </p> <p>Thank you for the fast answers :) </p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/iljapostnovs"><img src="https://avatars.githubusercontent.com/u/31005247?v=4" />iljapostnovs</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <blockquote> <p>Yes, if I have a little time, I could debug it.</p> <p>Thank you for the fast answers :)</p> </blockquote> <p>Thanks! I can guide you a bit: Chain of XML Linter looks as follows: <code>DiagnosticsRegistrator</code> : <code>_updateXMLDiagnostics</code> -> <code>XMLLinter</code> (ui5plugin-linter) : <code>getLintingErrors</code> -> and then every linter gets called sequentially. Obviously, something went wrong with positions of the errors, so maybe that could be checked. E.g. <code>TagAttributeLinter</code> : <code>_getTagAttributeErrors</code>, position is taken from tag.positionBegin, and tag position is generated in <code>XMLParser</code>:<code>getTagBeginEndPosition</code> (ui5plugin-parser), so maybe those places could be checked as well.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/iljapostnovs"><img src="https://avatars.githubusercontent.com/u/31005247?v=4" />iljapostnovs</a> commented <strong> 10 months ago</strong> </div> <div class="markdown-body"> <p>Closed because of inactivity</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>