deco - use correct/overwrite decorations in scm viewlet because the same URI can have multiple decorations

This commit is contained in:
Johannes Rieken
2017-10-26 17:01:03 +02:00
parent 86cd46a44e
commit 47e1c93285
13 changed files with 105 additions and 44 deletions

View File

@@ -378,8 +378,8 @@ export function createApiFactory(
sampleFunction: proposedApiFunction(extension, () => {
return extHostMessageService.showMessage(extension, Severity.Info, 'Hello Proposed Api!', {}, []);
}),
registerDecorationProvider: proposedApiFunction(extension, (provider: vscode.DecorationProvider, source) => {
return extHostDecorations.registerDecorationProvider(provider, source);
registerDecorationProvider: proposedApiFunction(extension, (provider: vscode.DecorationProvider) => {
return extHostDecorations.registerDecorationProvider(provider, extension.id);
})
};

View File

@@ -368,7 +368,11 @@ export type SCMRawResource = [
string[] /*icons: light, dark*/,
string /*tooltip*/,
boolean /*strike through*/,
boolean /*faded*/
boolean /*faded*/,
string /*source*/,
string /*letter*/,
ThemeColor /*color*/
];
export type SCMRawResourceSplice = [

View File

@@ -244,7 +244,11 @@ class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceG
const strikeThrough = r.decorations && !!r.decorations.strikeThrough;
const faded = r.decorations && !!r.decorations.faded;
return [handle, sourceUri, icons, tooltip, strikeThrough, faded] as SCMRawResource;
const source = r.decorations && r.decorations.source;
const letter = r.decorations && r.decorations.letter;
const color = r.decorations && r.decorations.color;
return [handle, sourceUri, icons, tooltip, strikeThrough, faded, source, letter, color] as SCMRawResource;
});
handlesToDelete.push(...this._handlesSnapshot.splice(start, deleteCount, ...handles));