de-emphasize duplicate dependencies (#678)
Signed-off-by: Yan Zhang <yanzh@microsoft.com>
This commit is contained in:
Родитель
1f522cda82
Коммит
b274875389
|
@ -3,16 +3,20 @@
|
|||
|
||||
import * as vscode from "vscode";
|
||||
|
||||
const DECORATION_CONFLICT: vscode.FileDecoration = new vscode.FileDecoration("C", "conflict", new vscode.ThemeColor("list.warningForeground"));
|
||||
const DECORATION_DUPLICATE: vscode.FileDecoration = new vscode.FileDecoration("D", "duplicate", new vscode.ThemeColor("list.deemphasizedForeground"));
|
||||
|
||||
class DecorationProvider implements vscode.FileDecorationProvider {
|
||||
private disposables: vscode.Disposable[] = [];
|
||||
private decoration: vscode.FileDecoration = {color: new vscode.ThemeColor("list.warningForeground")};
|
||||
constructor() {
|
||||
this.disposables.push(vscode.window.registerFileDecorationProvider(this));
|
||||
}
|
||||
|
||||
public provideFileDecoration(uri: vscode.Uri): vscode.ProviderResult<vscode.FileDecoration> {
|
||||
if (uri.query === "hasConflict") {
|
||||
return this.decoration;
|
||||
return DECORATION_CONFLICT;
|
||||
} else if (uri.query === "isDuplicate") {
|
||||
return DECORATION_DUPLICATE;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
export interface IOmittedStatus {
|
||||
status: string;
|
||||
status: "conflict" | "duplicate" | "normal";
|
||||
effectiveVersion: string;
|
||||
description?: string;
|
||||
}
|
||||
|
|
|
@ -109,6 +109,8 @@ async function parseTreeNodes(treecontent: string, eol: string, indent: string,
|
|||
break;
|
||||
}
|
||||
}
|
||||
} else if (curNode.omittedStatus.status === "duplicate") {
|
||||
curNode.uri = uri.with({query: "isDuplicate"});
|
||||
} else {
|
||||
curNode.uri = uri;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче