vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Output Channel not coloring keywords anymore

Open kaestlyn opened this issue 10 years ago • 10 comments

  • VSCode Version: 1.0.0
  • OS Version: Windows 7 SP1

Steps to Reproduce:

  1. Make a simple extension:
let output = vscode.window.createOutputChannel( 'CM' );        
output.appendLine( "warning: nothing" );
output.appendLine( "[warning not colored]" );
  1. Previously, using certain keywords in this fashion would be colored.

I know there are plans in the future to allow more advanced coloring in output channels, but my extension was using this as a workaround to callout important output.

Before: image

After: image

kaestlyn avatar Apr 14 '16 19:04 kaestlyn

@bpasero I see that we only handle ansi output for repl, have we ever done this for output? How was this working before might you know?

isidorn avatar Apr 15 '16 08:04 isidorn

@isidorn check if output mode is still properly being used: https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/output/common/outputMode.ts

bpasero avatar Apr 15 '16 09:04 bpasero

@bpasero I think it is still properly used since I see the links are nicely computed in the output. I also see it properly registered here

isidorn avatar Apr 15 '16 13:04 isidorn

If there is another way to color the output, I'd love to do it that way versus wrapping my lines with [Error ...] and [Warning ..] etc :smile:

kaestlyn avatar Apr 15 '16 13:04 kaestlyn

I can reproduce. @aeschli could this be a regression from theme work? The output mode applies tokens like token error-token output Log and these do not get coloured anymore.

bpasero avatar Apr 15 '16 14:04 bpasero

More tokens are outlined here: https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/output/common/outputMode.ts#L32

bpasero avatar Apr 15 '16 14:04 bpasero

Yes, the error-token rules got removed. Feel free to add it again to token.css

aeschli avatar Apr 15 '16 19:04 aeschli

It looks like this commit earlier this month has removed the ability to color the output described above:

https://github.com/Microsoft/vscode/commit/9a57fba48c0c20d5a9a6dec6f35c6d63e0aa5e2d#diff-0ae4fd008d20fc694925b1e837ac1cc2

Is there a way to color the output still? Or is this no longer supported?

kaestlyn avatar Jul 01 '16 16:07 kaestlyn

Yes, that coloring story was not good at all. We need support for a) ANSI coloring in the output panel and maybe b) a way for an output channel to contribute rules for tokenization. Coming up with some hard coded keywords (info, error, warning) does not solve it for extensions in general.

bpasero avatar Jul 01 '16 16:07 bpasero

Sounds good, I'll let me users know its not possible at the moment, thanks!

kaestlyn avatar Jul 01 '16 16:07 kaestlyn