"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts" between
vscode-1.48.2.tar.gz and vscode-1.49.0.tar.gz

About: Visual Studio Code is a source code editor (available for Windows, macOS and Linux). It comes with built-in support for JavaScript, TypeScript and Node.js and has extensions for other languages (such as C++, C#, Java, Python, PHP, Go). Source code.

abstractKeybindingService.test.ts  (vscode-1.48.2):abstractKeybindingService.test.ts  (vscode-1.49.0)
skipping to change at line 19 skipping to change at line 19
import { ICommandService } from 'vs/platform/commands/common/commands'; import { ICommandService } from 'vs/platform/commands/common/commands';
import { ContextKeyExpr, IContext, IContextKeyService, IContextKeyServiceTarget, ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey'; import { ContextKeyExpr, IContext, IContextKeyService, IContextKeyServiceTarget, ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey';
import { AbstractKeybindingService } from 'vs/platform/keybinding/common/abstrac tKeybindingService'; import { AbstractKeybindingService } from 'vs/platform/keybinding/common/abstrac tKeybindingService';
import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding';
import { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingReso lver'; import { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingReso lver';
import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKe ybindingItem'; import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKe ybindingItem';
import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayo utResolvedKeybinding'; import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayo utResolvedKeybinding';
import { INotification, INotificationService, IPromptChoice, IPromptOptions, NoO pNotification, IStatusMessageOptions } from 'vs/platform/notification/common/not ification'; import { INotification, INotificationService, IPromptChoice, IPromptOptions, NoO pNotification, IStatusMessageOptions } from 'vs/platform/notification/common/not ification';
import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtil s'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtil s';
import { Disposable } from 'vs/base/common/lifecycle'; import { Disposable } from 'vs/base/common/lifecycle';
import { NullLogService } from 'vs/platform/log/common/log';
function createContext(ctx: any) { function createContext(ctx: any) {
return { return {
getValue: (key: string) => { getValue: (key: string) => {
return ctx[key]; return ctx[key];
} }
}; };
} }
suite('AbstractKeybindingService', () => { suite('AbstractKeybindingService', () => {
class TestKeybindingService extends AbstractKeybindingService { class TestKeybindingService extends AbstractKeybindingService {
private _resolver: KeybindingResolver; private _resolver: KeybindingResolver;
constructor( constructor(
resolver: KeybindingResolver, resolver: KeybindingResolver,
contextKeyService: IContextKeyService, contextKeyService: IContextKeyService,
commandService: ICommandService, commandService: ICommandService,
notificationService: INotificationService notificationService: INotificationService
) { ) {
super(contextKeyService, commandService, NullTelemetrySer vice, notificationService); super(contextKeyService, commandService, NullTelemetrySer vice, notificationService, new NullLogService());
this._resolver = resolver; this._resolver = resolver;
} }
protected _getResolver(): KeybindingResolver { protected _getResolver(): KeybindingResolver {
return this._resolver; return this._resolver;
} }
protected _documentHasFocus(): boolean { protected _documentHasFocus(): boolean {
return true; return true;
} }
skipping to change at line 170 skipping to change at line 171
statusMessageCalls!.push(message); statusMessageCalls!.push(message);
return { return {
dispose: () => { dispose: () => {
statusMessageCallsDispose d!.push(message); statusMessageCallsDispose d!.push(message);
} }
}; };
}, },
setFilter() { } setFilter() { }
}; };
let resolver = new KeybindingResolver(items, []); let resolver = new KeybindingResolver(items, [], () => { });
return new TestKeybindingService(resolver, contextKeyServ ice, commandService, notificationService); return new TestKeybindingService(resolver, contextKeyServ ice, commandService, notificationService);
}; };
}); });
teardown(() => { teardown(() => {
currentContextValue = null; currentContextValue = null;
executeCommandCalls = null!; executeCommandCalls = null!;
showMessageCalls = null!; showMessageCalls = null!;
createTestKeybindingService = null!; createTestKeybindingService = null!;
skipping to change at line 192 skipping to change at line 193
statusMessageCallsDisposed = null; statusMessageCallsDisposed = null;
}); });
function kbItem(keybinding: number, command: string, when?: ContextKeyExp ression): ResolvedKeybindingItem { function kbItem(keybinding: number, command: string, when?: ContextKeyExp ression): ResolvedKeybindingItem {
const resolvedKeybinding = (keybinding !== 0 ? new USLayoutResolv edKeybinding(createKeybinding(keybinding, OS)!, OS) : undefined); const resolvedKeybinding = (keybinding !== 0 ? new USLayoutResolv edKeybinding(createKeybinding(keybinding, OS)!, OS) : undefined);
return new ResolvedKeybindingItem( return new ResolvedKeybindingItem(
resolvedKeybinding, resolvedKeybinding,
command, command,
null, null,
when, when,
true true,
null
); );
} }
function toUsLabel(keybinding: number): string { function toUsLabel(keybinding: number): string {
const usResolvedKeybinding = new USLayoutResolvedKeybinding(creat eKeybinding(keybinding, OS)!, OS); const usResolvedKeybinding = new USLayoutResolvedKeybinding(creat eKeybinding(keybinding, OS)!, OS);
return usResolvedKeybinding.getLabel()!; return usResolvedKeybinding.getLabel()!;
} }
test('issue #16498: chord mode is quit for invalid chords', () => { test('issue #16498: chord mode is quit for invalid chords', () => {
 End of changes. 4 change blocks. 
3 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)