-
Notifications
You must be signed in to change notification settings - Fork 6
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
Support columns in annotations and expose path merging algorithm #167
base: main
Are you sure you want to change the base?
Conversation
This PR is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
As soon as test & CI is green, we can go ahead :) |
I will address this today or tomorrow 👌 |
1af5986
to
ac82b5c
Compare
|
Not sure what a brain method is supposed to be, but if there were a better way to write it by splitting it, I would have already done that. |
This PR is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
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.
Overall, the PR looks good. I have some minor suggestions before approving :)
return false; | ||
} | ||
|
||
return this.line() == that.line() && this.column() == that.column(); |
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.
== for references? column is an optional
} | ||
|
||
@Override | ||
public int hashCode() { |
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.
You can use Objects.hash directly
@@ -14,7 +14,9 @@ public record AnnotationDTO( | |||
@JsonProperty String uuid, |
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'd suggest to use the records like LineColumn directly.
|
||
// First collect only the lines so that we can later split the feedback by lines | ||
Collection<TranslatableString> lines = new ArrayList<>(); | ||
for (var entry : annotationsByType) { |
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.
You could refactor the inner parts of the for loops to helper methods.
Artemis seems to only support annotating an entire line. For grading, it is useful to support highlighting parts of a line.
For example, given this code and two annotations:
intelligrade would highlight everything in that line, even though it could just highlight the identifier and the magic number. The autograder already exposes the column information.
This PR closes #158.
In addition to that, it closes #163.
The formatting of paths
I implemented this code in multiple codebases now, mainly intelligrade and this library share similar code. That is why I decided to write a more refined version in artemis4j that can then be used in intelligrade as well.
After about 20 hours of work later, we end up with the code in this pull request.
With this PR, I learned that lines are 0-indexed and not 1-indexed. That is confusing, and nobody even noticed that the annotation merging code assumed they were 1-indexed. The bug is now fixed, but this should be checked in intelligrade.
This PR takes care of #159 as well
This PR closes #159.
This is the before:

After this PR is merged:
