forked from chapel-lang/chapel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print file path in detailed errors when jumping files (chapel-lang#23520
) This aims to resolve chapel-lang#21656. Though I've read Brad's opinion on the various sketches, I am not inclined to put the filename on the same line as the previous error message. The reason for this is that it doesn't mesh well with the current approach we take (each piece of the error message is a distinct call that writes text to a stream). To be able to splice the file from code output back into the line before it, we'd need the code that prints the error message to be coupled with the code that prints the lines of Chapel. Furthermore, the approach is not resilient to non-standard phrasing of the message above (it modifies them grammatically!). Thus, I've taken the approach of Rust error messages, and print the filename with an `-->` character. I think using delimiters makes the filename less likely to blend in with the sentence above (and, like I described above, actually making it blend in properly is hard). The error message from the issue now looks as follows: <img width="368" alt="Screen Shot 2023-09-21 at 5 08 18 PM" src="https://github.com/chapel-lang/chapel/assets/4361282/4ba23642-0453-4807-b928-43916ca4c569"> Reviewed by @mppf -- thanks! ## Testing - [x] paratest
- Loading branch information
Showing
2 changed files
with
48 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters