mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 12:33:35 +01:00
make event optional, event naming, relax badge length a little, https://github.com/microsoft/vscode/issues/54938
This commit is contained in:
@@ -42,7 +42,7 @@ export class ExtHostDecorations implements ExtHostDecorationsShape {
|
||||
this._provider.set(handle, { provider, extensionId });
|
||||
this._proxy.$registerDecorationProvider(handle, extensionId.value);
|
||||
|
||||
const listener = provider.onDidChange(e => {
|
||||
const listener = provider.onDidChangeFileDecorations && provider.onDidChangeFileDecorations(e => {
|
||||
if (!e) {
|
||||
this._proxy.$onDidChange(handle, null);
|
||||
return;
|
||||
@@ -75,7 +75,7 @@ export class ExtHostDecorations implements ExtHostDecorationsShape {
|
||||
});
|
||||
|
||||
return new Disposable(() => {
|
||||
listener.dispose();
|
||||
listener?.dispose();
|
||||
this._proxy.$unregisterDecorationProvider(handle);
|
||||
this._provider.delete(handle);
|
||||
});
|
||||
|
||||
@@ -2720,8 +2720,8 @@ export enum ExtensionKind {
|
||||
export class FileDecoration {
|
||||
|
||||
static validate(d: FileDecoration): void {
|
||||
if (d.badge && d.badge.length !== 1) {
|
||||
throw new Error(`The 'badge'-property must be undefined or a single character`);
|
||||
if (d.badge && (d.badge.length === 1 || d.badge.length === 2)) {
|
||||
throw new Error(`The 'badge'-property must be undefined or a short character`);
|
||||
}
|
||||
if (!d.color && !d.badge && !d.tooltip) {
|
||||
throw new Error(`The decoration is empty`);
|
||||
|
||||
Reference in New Issue
Block a user