remove automatic merging/overwriting of decorations, simplify proposed API, #54938

This commit is contained in:
Johannes Rieken
2019-09-04 10:52:31 +02:00
parent ddff4bc893
commit 07d19b90a5
14 changed files with 23 additions and 105 deletions

View File

@@ -661,11 +661,7 @@ export type SCMRawResource = [
string[] /*icons: light, dark*/,
string /*tooltip*/,
boolean /*strike through*/,
boolean /*faded*/,
string | undefined /*source*/,
string | undefined /*letter*/,
ThemeColor | null /*color*/
boolean /*faded*/
];
export type SCMRawResourceSplice = [
@@ -1272,7 +1268,7 @@ export interface DecorationRequest {
readonly uri: UriComponents;
}
export type DecorationData = [number, boolean, string, string, ThemeColor, string];
export type DecorationData = [number, boolean, string, string, ThemeColor];
export type DecorationReply = { [id: number]: DecorationData };
export interface ExtHostDecorationsShape {

View File

@@ -63,7 +63,7 @@ export class ExtHostDecorations implements IExtHostDecorations {
console.warn(`INVALID decoration from extension '${extensionId.value}'. The 'letter' must be set and be one character, not '${data.letter}'.`);
}
if (data) {
result[id] = <DecorationData>[data.priority, data.bubble, data.title, data.letter, data.color, data.source];
result[id] = <DecorationData>[data.priority, data.bubble, data.title, data.letter, data.color];
}
}, err => {

View File

@@ -319,11 +319,7 @@ class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceG
const strikeThrough = r.decorations && !!r.decorations.strikeThrough;
const faded = r.decorations && !!r.decorations.faded;
const source = r.decorations && r.decorations.source || undefined;
const letter = r.decorations && r.decorations.letter || undefined;
const color = r.decorations && r.decorations.color || undefined;
const rawResource = [handle, <UriComponents>sourceUri, icons, tooltip, strikeThrough, faded, source, letter, color] as SCMRawResource;
const rawResource = [handle, <UriComponents>sourceUri, icons, tooltip, strikeThrough, faded] as SCMRawResource;
return { rawResource, handle };
});