Allow to provide colorizers for specific output channels
formulahendry opened this issue ยท 13 comments
- VSCode Version: 1.8
- OS Version: All
One user of my Code Runner extension reported this issue: formulahendry/vscode-code-runner#59
Steps to Reproduce:
- Install Output Colorizer
- Install Code Runner
Result:
IBM's Output Colorizer extension is no longer working.
Both of us using text/x-code-output
(https://github.com/formulahendry/vscode-code-runner/blob/master/package.json#L197 , https://github.com/IBM-Bluemix/vscode-log-output-colorizer/blob/master/package.json#L4)
Not sure there is a way to avoid the color highlight of one extension overwriting another? Could the color highlight exsit for both extension?
As far as I understand, this issue asks about having colorisation from both extensions working on the same mime type. That is something we do not support.
@formulahendry am I understanding this correctly that you want your extension to only colorize the output from your extension but would want the IBM one to be used for all other output channels?
Hi @bpasero , you are right. That's what we want.
Ok, I have updated the summary. It would be cool if there was some kind of hierarchy in the output channel coloring where an extension could override the coloring for one channel the extension itself provides.
Here's the related feature request that ultimately addresses this one: #11005. If it was possible to assign a language to an output channel, it would be perfect.
+1 for this issue
However, @ArtemGovorov I don't think #11005 would solve this issue. I'm looking for a way to append lines to the output that don't adhere to a specific language and color them on the fly. For instance, I'm outputting the stdout and stderr I get back from a spawn call. I'd like to color the stderr to draw the user's attention to it.
I was looking for a feature that does this as well ๐
Hi @bpasero . React Native Tools extension team here. Recently we started to investigate how we can improve logging in the extension and found out that there is no consistent way to colorize output logs in VS Code, so we would like to reboot this conversation.
We tried to add grammars which are specific for our extension but it seems that they will also be used by other extensions that are installed even if the React Native Tools is not activated.
Also we tried to use VS Code Programmatic language features to register grammars only after the extension activation to reduce side effects, but it seems that currently VS Code doesn't provide an ability to add such grammars in runtime. But even if it is possible, the problem when one grammar overlaps another still persists, because all the output channels are of the same mime type.
So we think that this feature might be interesting not only for the React Native Tools, but also for other extensions since it provides enhanced logs readability and helps to mark warnings and errors with special color codes and might help to decrease the amount of issues due to 'not enough informative logs' and other similar reasons.
Hey @bpasero. We are looking forward to discuss this topic.
FYI @connor4312 , @EricCornelson.
@SounD120 I think this is a fair feature request and it should be in "Backlog" to signal this. However we have a couple of thousand other issues also in "Backlog" that we also need to consider. If you want to push this onto our agenda for a milestone, you need to connect with PMs/devleads from our team if possible. Thanks for understanding.
Thanks to @gjsjohnmurray for contributing the PR to support languages to the Output Channel. Here is the proposal
/**
* Creates a new {@link OutputChannel output channel} with the given name.
*
* @param name Human-readable string which will be used to represent the channel in the UI.
* @param languageId The identifier of the language associated with the channel.
*/
export function createOutputChannel(name: string, languageId?: string): OutputChannel;
API proposal is pushed to main branch. Will give some time for testing and finalize in next month.
API is made public and will be available from next release (1.66.0)