-
Notifications
You must be signed in to change notification settings - Fork 55
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
Move Pants output to console view instead of notification channel #242
Conversation
This reverts commit b152ade.
} | ||
|
||
|
||
public void testErrorMessageWithLocation2() { |
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.
what's the difference from the java test case? seems redundant
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! I will remove having certain file extensions as a requirement, because eventually we will check if it is a valid file path when constructing the hyperlink.
|
||
try { | ||
// filePath path is between tag and first colon | ||
String filePath = splitByColon[0].substring(splitByColon[0].indexOf(tag) + tag.length()).trim(); |
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.
some negative examples from old log
[error] Compile failed at Dec 9, 2016 6:33:30 AM [0.080s]
[error] Assert.assertEquals("0:00:00.000", ManagementUtils.getAverageAge(d0));
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.
It's okay for String filePath
to be Assert.assertEquals("0
for example, because the hyperlink construction will check if it is an actual file. If not, it will there will be no hyperlinks.
I will add more doc to this to be more clear.
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.
More doc added, as well as test case to cover this.
OpenFileHyperlinkInfo linkInfo = new OpenFileHyperlinkInfo( | ||
project, | ||
result.get().getFile(), | ||
result.get().lineNumber - 1, // line number needs to be 0 indexed |
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.
getLineNumber
getColumnNumber
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.
q: in case we have a invalid line number either <0
or > max actual line#
what will happen? as long as it doesn't crash.
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.
- corrected.
- Manually tested by intentionally feeding it with line number -1, there is no crash, just the cursor is somewhere random.
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.
- Non numbers will be caught by
NumberFormatException
, and return no link.
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 @peiyuwang ! |
Problem
Pants output used to go out via the IntelliJ notification channel with a few down sides:
^
will show up off.Solution
Use a text console view, which has