-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[output] add severity/color to appendLine method #7549
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amiramw do you mind updating the pull-request's 'how to test' so a reviewer can verify the output for both errors and warnings? I was unable to do so with the description provided.
const lines = outputChannelLine.text.split(/[\n\r]+/); | ||
let className; | ||
if (outputChannelLine.severity === OutputChannelSeverity.Error) { | ||
className = 'theia-console-error'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure these are the correct classes to use as they are contributed by console
.
It is possible to build an application without console
, and in this scenario, coloring present in the output view will not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created new classes in output package styles
Would it be possible to keep it after we switch to use Monaco editor for the output to align with VS Code and get features like search and so on? |
@akosyakov sure. But will colors be possible after the move? VS code doesn't have this feature as far as I know. |
@amiramw It was my question :) But thinking now, Monaco editor has decorators API to color text. So it should be. Please address @vince-fugnitto comment: #7549 (comment) The output extension should not have implicit dependencies on the console extension via css classes. |
@akosyakov i wasn't aware that vscode uses monaco editor component also for the output. Anyway for now I'm addressing CR comments... |
@vince-fugnitto I updated the how to test section. There is another PR with test example. |
a567ee7
to
88ae8e8
Compare
Any clue why the build is failing now? |
@amiramw I'm looking into the build failure. |
Adding a new dependency to |
I didn't, thought it was generated wrongly. I'll check again. |
Signed-off-by: Amiram Wingarten <amiram.wingarten@sap.com>
@kittaakos Seems that build is fine now and i fixed your comment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amiramw, ping me if you cannot do the merge. |
Thansks @kittaakos! Merging. |
Signed-off-by: Amiram Wingarten amiram.wingarten@sap.com
Fixes #7504
What it does
Add severity to append methods of output channel. This allow to color output lines for errors and warnings.
How to test
For some output channel call
appendLine
with severities info, warning and error.The output lines should color accordingly, warning in yellow and error in red.
Call
append
method - it should behave as info.See example examples/api-samples/src/browser/output/sample-output-channel-with-severity.ts
Also test application can be found in #7600
theia/packages/output/src/browser/test-app.ts
Lines 26 to 32 in d26c403
The expected output channel "my test channel" should look like this after theia start:
Review checklist
Reminder for reviewers