🐛 SourceControlResourceDecorations.faded

fixes #24097
This commit is contained in:
Joao Moreno
2017-04-27 15:24:58 +02:00
parent 3f0c6c8a5b
commit 9b7a8813e0
8 changed files with 56 additions and 27 deletions

View File

@@ -284,7 +284,8 @@ export type SCMRawResource = [
string /*resourceUri*/,
modes.Command /*command*/,
string[] /*icons: light, dark*/,
boolean /*strike through*/
boolean /*strike through*/,
boolean /*faded*/
];
export abstract class MainThreadSCMShape {

View File

@@ -115,8 +115,9 @@ class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceG
}
const strikeThrough = r.decorations && !!r.decorations.strikeThrough;
const faded = r.decorations && !!r.decorations.faded;
return [handle, sourceUri, command, icons, strikeThrough] as SCMRawResource;
return [handle, sourceUri, command, icons, strikeThrough, faded] as SCMRawResource;
});
this._proxy.$updateGroupResourceStates(this._sourceControlHandle, this._handle, rawResources);

View File

@@ -2,6 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { TPromise } from 'vs/base/common/winjs.base';
@@ -10,7 +11,7 @@ import Event, { Emitter } from 'vs/base/common/event';
import { assign } from 'vs/base/common/objects';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
import { ISCMService, ISCMProvider, ISCMResource, ISCMResourceGroup } from 'vs/workbench/services/scm/common/scm';
import { ISCMService, ISCMProvider, ISCMResource, ISCMResourceGroup, ISCMResourceDecorations } from 'vs/workbench/services/scm/common/scm';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { ExtHostContext, MainThreadSCMShape, ExtHostSCMShape, SCMProviderFeatures, SCMRawResource, SCMGroupFeatures } from './extHost.protocol';
@@ -46,7 +47,7 @@ class MainThreadSCMResource implements ISCMResource {
public sourceUri: URI,
public command: Command | undefined,
public resourceGroup: ISCMResourceGroup,
public decorations
public decorations: ISCMResourceDecorations
) { }
toJSON(): any {
@@ -144,13 +145,14 @@ class MainThreadSCMProvider implements ISCMProvider {
}
group.resources = resources.map(rawResource => {
const [handle, sourceUri, command, icons, strikeThrough] = rawResource;
const [handle, sourceUri, command, icons, strikeThrough, faded] = rawResource;
const icon = icons[0];
const iconDark = icons[1] || icon;
const decorations = {
icon: icon && URI.parse(icon),
iconDark: iconDark && URI.parse(iconDark),
strikeThrough
strikeThrough,
faded
};
return new MainThreadSCMResource(