Merge from vscode 011858832762aaff245b2336fb1c38166e7a10fb (#4663)

This commit is contained in:
Anthony Dresser
2019-03-22 13:07:54 -07:00
committed by GitHub
parent f5c9174c2f
commit 4a87a24235
296 changed files with 2531 additions and 2472 deletions

View File

@@ -252,7 +252,7 @@ export abstract class AbstractContextKeyService implements IContextKeyService {
return new ScopedContextKeyService(this, this._onDidChangeContextKey, domNode);
}
public contextMatchesRules(rules: ContextKeyExpr | null): boolean {
public contextMatchesRules(rules: ContextKeyExpr | undefined): boolean {
if (this._isDisposed) {
throw new Error(`AbstractContextKeyService has been disposed`);
}

View File

@@ -58,14 +58,15 @@ export abstract class ContextKeyExpr {
public static greaterThanEquals(key: string, value: any): ContextKeyExpr {
return new ContextKeyGreaterThanEqualsExpr(key, value);
}
public static lessThanEquals(key: string, value: any): ContextKeyExpr {
return new ContextKeyLessThanEqualsExpr(key, value);
}
//
public static deserialize(serialized: string | null | undefined, strict: boolean = false): ContextKeyExpr | null {
public static deserialize(serialized: string | null | undefined, strict: boolean = false): ContextKeyExpr | undefined {
if (!serialized) {
return null;
return undefined;
}
let pieces = serialized.split('&&');
@@ -167,7 +168,7 @@ export abstract class ContextKeyExpr {
public abstract getType(): ContextKeyExprType;
public abstract equals(other: ContextKeyExpr): boolean;
public abstract evaluate(context: IContext): boolean;
public abstract normalize(): ContextKeyExpr | null;
public abstract normalize(): ContextKeyExpr | undefined;
public abstract serialize(): string;
public abstract keys(): string[];
public abstract map(mapFnc: IContextKeyExprMapper): ContextKeyExpr;
@@ -549,9 +550,9 @@ export class ContextKeyAndExpr implements ContextKeyExpr {
return expr;
}
public normalize(): ContextKeyExpr | null {
public normalize(): ContextKeyExpr | undefined {
if (this.expr.length === 0) {
return null;
return undefined;
}
if (this.expr.length === 1) {
@@ -762,7 +763,7 @@ export interface IContextKeyService {
onDidChangeContext: Event<IContextKeyChangeEvent>;
createKey<T>(key: string, defaultValue: T | undefined): IContextKey<T>;
contextMatchesRules(rules: ContextKeyExpr | null): boolean;
contextMatchesRules(rules: ContextKeyExpr | undefined): boolean;
getContextKeyValue<T>(key: string): T | undefined;
createScoped(target?: IContextKeyServiceTarget): IContextKeyService;