What happened?
Flycheck’s scala checker creates outputs with ansi color escape codes that does not render properly in +popups. I’ve tried add-advice
with a function that essentially does (ansi-color-apply-on-region (point-min) (point-max)), but either it works on the
Message` buffer only, only works when I click into the +popup as the “active buffer”, or doesn’t trigger at all.
In any case, I’ve looked on github, used various GPTs, checked the discord, and cannot for the life of me understand how some output in the +popup is able to be colorised (e.g. importing project via lsp) but this cannot. I believe ansi-color codes need to be translated to emacs color tags or faces, but, again, I cannot seem to find a way to do it on the +popup.
I’ve tried hooks and advice on:
flycheck-display-error-messages
flycheck-report-buffer-checker-status
flycheck-display-errors-in-list
-
flycheck-mode
(hook) -
+popup--init
(hook) - and others
I’ve added (require 'ansi-color)
in my config.el and ran doom sync
.
Also: running in (interactive t) and calling when activating the buffer does colorize the output, so I know the issue is simply knowing which function to add advice to OR how to grab the +popup buffer/window/frame ??? (see supporting images)
What did you expect to happen?
Color output should work when flycheck: scala emits a message
Steps to reproduce
- open a .scala document
- do not import project (no lsp, just use flycheck syntax checking)
- start writing some code, like
implicit def foo
- wait for flycheck to run
- see uncolorized output
System information
Supporting images:
the noisy output:
when clicking the +popup and running my function interactively works:
How can I get this “onpopup”??? What is the function to wrap?
Thanks.