diff --git a/packages/git/src/browser/git-scm-provider.ts b/packages/git/src/browser/git-scm-provider.ts index 9bd1ef446e534..ef18a95022d0b 100644 --- a/packages/git/src/browser/git-scm-provider.ts +++ b/packages/git/src/browser/git-scm-provider.ts @@ -214,7 +214,8 @@ export class GitScmProvider implements ScmProvider { decorations: { letter: GitFileStatus.toAbbreviation(change.status, change.staged), color: GitFileStatus.getColor(change.status, change.staged), - tooltip: GitFileStatus.toString(change.status) + tooltip: GitFileStatus.toString(change.status), + strikeThrough: GitFileStatus.toStrikethrough(change.status) }, open: async () => this.open(change, { mode: 'reveal' }) }); diff --git a/packages/git/src/common/git-model.ts b/packages/git/src/common/git-model.ts index 894a5488f978e..ebf326195e848 100644 --- a/packages/git/src/common/git-model.ts +++ b/packages/git/src/common/git-model.ts @@ -150,6 +150,10 @@ export namespace GitFileStatus { } } + export function toStrikethrough(status: GitFileStatus): boolean { + return status === GitFileStatus.Deleted; + } + } /** diff --git a/packages/scm/src/browser/scm-provider.ts b/packages/scm/src/browser/scm-provider.ts index fc6f391327a13..df4dc3542c3c9 100644 --- a/packages/scm/src/browser/scm-provider.ts +++ b/packages/scm/src/browser/scm-provider.ts @@ -62,6 +62,7 @@ export interface ScmResourceDecorations { source?: string; letter?: string; color?: string; + strikeThrough?: boolean; } export interface ScmCommand { diff --git a/packages/scm/src/browser/scm-tree-widget.tsx b/packages/scm/src/browser/scm-tree-widget.tsx index 5b7c250fa7474..5ebbdd1466b7d 100644 --- a/packages/scm/src/browser/scm-tree-widget.tsx +++ b/packages/scm/src/browser/scm-tree-widget.tsx @@ -536,6 +536,7 @@ export class ScmResourceComponent extends ScmElement const color = decoration && decoration.colorId ? `var(${colors.toCssVariableName(decoration.colorId)})` : ''; const letter = decoration && decoration.letter || ''; const tooltip = decoration && decoration.tooltip || ''; + const textDecoration = treeNode.decorations?.strikeThrough === true ? 'line-through' : 'normal'; const relativePath = parentPath.relative(resourceUri.parent); const path = relativePath ? relativePath.fsPath() : labelProvider.getLongName(resourceUri.parent); const title = tooltip.length !== 0 @@ -554,8 +555,8 @@ export class ScmResourceComponent extends ScmElement {this.props.renderExpansionToggle()}
- {caption} - {path} + {caption} + {path}