mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 09:35:41 -05:00
Merge VS Code 1.23.1 (#1520)
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingResolver';
|
||||
import { IContextKey, IContext, IContextKeyServiceTarget, IContextKeyService, SET_CONTEXT_COMMAND_ID, ContextKeyExpr, IContextKeyChangeEvent } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IContextKey, IContext, IContextKeyServiceTarget, IContextKeyService, SET_CONTEXT_COMMAND_ID, ContextKeyExpr, IContextKeyChangeEvent, IReadableSet } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IConfigurationService, IConfigurationChangeEvent, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
import Event, { Emitter, debounceEvent } from 'vs/base/common/event';
|
||||
import { Event, Emitter, debounceEvent } from 'vs/base/common/event';
|
||||
|
||||
const KEYBINDING_CONTEXT_ATTR = 'data-keybinding-context';
|
||||
|
||||
@@ -179,7 +179,7 @@ export class ContextKeyChangeEvent implements IContextKeyChangeEvent {
|
||||
this._keys = this._keys.concat(oneOrManyKeys);
|
||||
}
|
||||
|
||||
affectsSome(keys: Set<string>): boolean {
|
||||
affectsSome(keys: IReadableSet<string>): boolean {
|
||||
for (const key of this._keys) {
|
||||
if (keys.has(key)) {
|
||||
return true;
|
||||
@@ -271,7 +271,7 @@ export class ContextKeyService extends AbstractContextKeyService implements ICon
|
||||
|
||||
private _toDispose: IDisposable[] = [];
|
||||
|
||||
constructor( @IConfigurationService configurationService: IConfigurationService) {
|
||||
constructor(@IConfigurationService configurationService: IConfigurationService) {
|
||||
super(0);
|
||||
this._lastContextId = 0;
|
||||
this._contexts = Object.create(null);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import Event from 'vs/base/common/event';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { isFalsyOrWhitespace } from 'vs/base/common/strings';
|
||||
|
||||
export enum ContextKeyExprType {
|
||||
@@ -112,8 +112,9 @@ export abstract class ContextKeyExpr {
|
||||
}
|
||||
|
||||
let value = serializedValue.slice(start + 1, end);
|
||||
let caseIgnoreFlag = serializedValue[end + 1] === 'i' ? 'i' : '';
|
||||
try {
|
||||
return new RegExp(value);
|
||||
return new RegExp(value, caseIgnoreFlag);
|
||||
} catch (e) {
|
||||
console.warn(`bad regexp-value '${serializedValue}', parse error: ${e}`);
|
||||
return null;
|
||||
@@ -400,7 +401,7 @@ export class ContextKeyRegexExpr implements ContextKeyExpr {
|
||||
}
|
||||
|
||||
public serialize(): string {
|
||||
return `${this.key} =~ /${this.regexp ? this.regexp.source : '<invalid>'}/`;
|
||||
return `${this.key} =~ /${this.regexp ? this.regexp.source : '<invalid>'}/${this.regexp.ignoreCase ? 'i' : ''}`;
|
||||
}
|
||||
|
||||
public keys(): string[] {
|
||||
@@ -553,8 +554,12 @@ export interface IContextKeyServiceTarget {
|
||||
|
||||
export const IContextKeyService = createDecorator<IContextKeyService>('contextKeyService');
|
||||
|
||||
export interface IReadableSet<T> {
|
||||
has(value: T): boolean;
|
||||
}
|
||||
|
||||
export interface IContextKeyChangeEvent {
|
||||
affectsSome(keys: Set<string>): boolean;
|
||||
affectsSome(keys: IReadableSet<string>): boolean;
|
||||
}
|
||||
|
||||
export interface IContextKeyService {
|
||||
|
||||
@@ -81,6 +81,7 @@ suite('ContextKeyExpr', () => {
|
||||
testExpression(expr + ' != 5', value != <any>'5');
|
||||
testExpression('!' + expr, !value);
|
||||
testExpression(expr + ' =~ /d.*/', /d.*/.test(value));
|
||||
testExpression(expr + ' =~ /D/i', /D/i.test(value));
|
||||
}
|
||||
|
||||
testBatch('a', true);
|
||||
@@ -92,7 +93,7 @@ suite('ContextKeyExpr', () => {
|
||||
testExpression('a && !b', true && !false);
|
||||
testExpression('a && b', true && false);
|
||||
testExpression('a && !b && c == 5', true && !false && '5' == '5');
|
||||
testExpression('dddd =~ d.*', false);
|
||||
testExpression('d =~ /e.*/', false);
|
||||
/* tslint:enable:triple-equals */
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user