-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add validation reason and distinguish between live and batch validation #200
Conversation
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.
Thanks Philip, support for live validation is definitely a nice feature addition.
I did not have time to test the changes yet and only did a preliminary code review for now.
.../org.eclipse.glsp.server/src/org/eclipse/glsp/server/features/validation/ModelValidator.java
Show resolved
Hide resolved
.../org.eclipse.glsp.server/src/org/eclipse/glsp/server/features/validation/ModelValidator.java
Show resolved
Hide resolved
} else { | ||
markers.addAll(doBatchValidation(element)); | ||
} | ||
if (element.getChildren() != null) { |
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.
I think this is a unnecessary null-check. List properties of EObjects are always defined and should never be null. We should rather check if the children list is not empty.
|
||
public RequestMarkersAction() { | ||
this(new ArrayList<>()); | ||
} | ||
|
||
public RequestMarkersAction(final List<String> elementsIDs) { | ||
this(elementsIDs, null); |
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.
In the client change you mentioned that the default reason is batch
. So we should use it here has default value instead of null.
|
||
} | ||
String reason = action.getReason() != null ? action.getReason() : MarkersReason.BATCH; |
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.
See comment above. If the default is already properly set in the action class we don't need to handle it explicitly here.
Thank you for the excellent review! I've applied your suggestions with b8a020f. |
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.
Thanks for the fast update! LGTM 👍🏼
eclipse-glsp/glsp#980
For review, please see the comment on which changes belong together.