Skip to content

Commit

Permalink
Highlight variable change type
Browse files Browse the repository at this point in the history
Signed-off-by: Afonso Fernandes <21228942+afonsonf@users.noreply.github.com>
  • Loading branch information
afonsonf authored and lemmy committed Sep 10, 2023
1 parent 96bad1a commit 8371e8b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@ export const ErrorTraceVariable = React.memo(({value, stateId, settings}: ErrorT
vscode.showInfoMessage('Value has been copied to clipboard');
};

const varDeletedClass = value.changeType === 'D' ? 'value-deleted' : '';
const changeTypeClass = 'value-'+value.changeType;

return (
<VSCodeTreeItem expanded={expanded} onExpandedChanged={handleExpanded}>
<div className="var-block">
<div className="var-name">
<span className={varDeletedClass}> {value.key} </span>
<div className="var-name" title={changeHints[value.changeType]}>
<span className={changeTypeClass}> {value.key} </span>

{value.items &&
<span className="var-size" title="Size of the collection"> ({value.items.length}) </span>}

{value.changeType !== 'N' &&
<span
title={changeHints[value.changeType]}
className={`change-marker change-marker-${value.changeType}`}>
<span className={`change-marker change-marker-${value.changeType}`}>
{value.changeType}
</span>}
</div>

<div className={'var-value ' + varDeletedClass}> {value.str} </div>
<div className={'var-value ' + changeTypeClass} title={changeHints[value.changeType]}>
{value.str}
</div>

<div className="var-menu">
<span
Expand Down
10 changes: 9 additions & 1 deletion src/webview/checkResultView/errorTraceSection/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,15 @@
color: var(--vscode-gitDecoration-deletedResourceForeground);
}

.value-deleted {
.value-D {
opacity: 0.6;
text-decoration: line-through;
}

.value-A {
text-decoration: underline var(--vscode-gitDecoration-addedResourceForeground);
}

.value-M {
text-decoration: underline dotted var(--vscode-gitDecoration-modifiedResourceForeground);
}

0 comments on commit 8371e8b

Please sign in to comment.