-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(xml-views-validation): avoid false positive errors for unknown tags #144
Conversation
If an unknown tag was under a none namespace UI5 entity fqn, e.g the FQN of an enum/interface it would be treated as a valid known namespace and thus an error would occur.
failure on nodejs 10 is unrelated to this change, Seems master is failing too with some timeout |
xmlns:mvc="sap.ui.core.mvc" | ||
<!-- The error should be on the definition of an invalid xmlns which is not a UI5Namespace rather than on each usage --> | ||
xmlns:AvatarColor="sap.m.AvatarColor"> | ||
<AvatarColor:Green> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why shouldn't this give an error? Green
isn't a class (or aggregation), it can't appear in a tag name. An error here is not a false positive. It would fail in runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we had xmlns:bamba="sap.m.Bamba" would we have given an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also there is only one error here imho, the invalid namespace.
Every usage of the namespace in a tag should not be an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we had
xmlns:bamba="sap.m.Bamba" would we have given an error?
We would have given a warning on the namespace because we don't know it and it's in an sap library namespace (sap.m). We would not have given an error (or done validations, or code assist) on tags that use this namespace because we consider it to be a custom namespace.
This isn't the case when you put an existing symbol name in the xmlns attribute. That is known (so we can't say it's an "unknown namespace"). It cannot be considered a custom namespace (so we cannot treat tags that use it as possible custom controls that should be excluded from validations). And it might have classes inside it which we should validate and suggest for code completion.
No capacity to continue with this, closing at this time. It will be tracked in #262 |
If an unknown tag was under a none namespace UI5 entity fqn, e.g the FQN of an enum/interface it
would be treated as a valid known namespace and thus an error would occur.