Skip to content

Commit

Permalink
Colorize in debug console for evaluation results
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorn committed Oct 9, 2017
1 parent 7807e1e commit c154688
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ export function renderExpressionValue(expressionOrValue: debug.IExpression | str
}
}

if (options.colorize) {
if (!isNaN(+value)) {
if (options.colorize && typeof expressionOrValue !== 'string') {
if (expressionOrValue.type === 'number' || expressionOrValue.type === 'boolean' || expressionOrValue.type === 'string') {
dom.addClass(container, expressionOrValue.type);
} else if (!isNaN(+value)) {
dom.addClass(container, 'number');
} else if (booleanRegex.test(value)) {
dom.addClass(container, 'boolean');
Expand Down
3 changes: 2 additions & 1 deletion src/vs/workbench/parts/debug/electron-browser/replViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ export class ReplExpressionsRenderer implements IRenderer {
templateData.input.textContent = expression.name;
renderExpressionValue(expression, templateData.value, {
preserveWhitespace: !expression.hasChildren,
showHover: false
showHover: false,
colorize: true
});
if (expression.hasChildren) {
templateData.annotation.className = 'annotation octicon octicon-info';
Expand Down

0 comments on commit c154688

Please sign in to comment.