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
compiler option to enable color in important keywords of the output in a terminal #6481
Comments
Comment author: @damiendoligez Are you talking about the toplevel? I don't think it would be worth the trouble implementing this. Syntax-coloring rightly belongs in the text editor or IDE that you use to write OCaml code. |
Comment author: berenger No, I am talking about the compiler messages. |
Comment author: berenger Should I look only into yacc/error.c in order to enable this? |
Comment author: @gasche No, those are the errors raised by the ocamlyacc program (when parsing a .mly file). The syntax errors for OCaml are handled in parsing/syntaxerr.ml, but they call utility function in parsing/location.ml that do the actual location-reporting and warning/error printing job. Note that Merlin ( https://github.com/the-lambda-church/merlin ) already does the job of giving visual signals about the error/warning status, and does many other things. Working with compiler messages outside a text editor is a waste of time, as long as it doesn't let you automatically jump to the error location in the right file -- a major time-saver. I'm skeptical about coloring the batch output for this reason. |
Comment author: @damiendoligez If you are using your eyes to parse the output of the compiler looking for error and warning messages, you are doing it wrong. Emacs has had a mode for that for more than 25 years, and I expect other IDEs to have the same functionality. You shouldn't be using the compiler in a terminal, except for simple testing. I'm strongly inclined to reject this feature wish because it represents a lot of implementation work and the benefit is negative (it discourages users from using a good IDE). Any dissenting opinion? |
Comment author: berenger this can be closed I think |
Original bug ID: 6481
Reporter: berenger
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2016-12-07T10:36:55Z)
Resolution: won't fix
Priority: normal
Severity: feature
Platform: unix-likes
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @gasche
Bug description
Hello,
Keywords such as (File, Warning, Error, line, characters),
if colored differently than the rest of the text
allow developpers to catch more easily with the eyes
important parts of the output messages.
If there was a way to allow choosing the color for
a given keyword, for example via an env. var. or
a .rc file, that would be wonderful.
I have used various ways to do that over the years out
of the compiler, but it always gets broken at some point.
Regards,
F.
The text was updated successfully, but these errors were encountered: