mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 011858832762aaff245b2336fb1c38166e7a10fb (#4663)
This commit is contained in:
@@ -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`);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user