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

@@ -63,16 +63,16 @@ export class Colorizer {
// Send out the event to create the mode
modeService.triggerMode(language);
let tokenizationSupport = TokenizationRegistry.get(language);
const tokenizationSupport = TokenizationRegistry.get(language);
if (tokenizationSupport) {
return _colorize(lines, tabSize, tokenizationSupport);
}
let tokenizationSupportPromise = TokenizationRegistry.getPromise(language);
const tokenizationSupportPromise = TokenizationRegistry.getPromise(language);
if (tokenizationSupportPromise) {
// A tokenizer will be registered soon
return new Promise<string>((resolve, reject) => {
tokenizationSupportPromise!.then(tokenizationSupport => {
tokenizationSupportPromise.then(tokenizationSupport => {
_colorize(lines, tabSize, tokenizationSupport).then(resolve, reject);
}, reject);
});

View File

@@ -280,7 +280,7 @@ export class StandaloneKeybindingService extends AbstractKeybindingService {
}));
}
public addDynamicKeybinding(commandId: string, _keybinding: number, handler: ICommandHandler, when: ContextKeyExpr | null): IDisposable {
public addDynamicKeybinding(commandId: string, _keybinding: number, handler: ICommandHandler, when: ContextKeyExpr | undefined): IDisposable {
const keybinding = createKeybinding(_keybinding, OS);
if (!keybinding) {
throw new Error(`Invalid keybinding`);
@@ -342,7 +342,7 @@ export class StandaloneKeybindingService extends AbstractKeybindingService {
private _toNormalizedKeybindingItems(items: IKeybindingItem[], isDefault: boolean): ResolvedKeybindingItem[] {
let result: ResolvedKeybindingItem[] = [], resultLen = 0;
for (const item of items) {
const when = (item.when ? item.when.normalize() : null);
const when = (item.when ? item.when.normalize() : undefined);
const keybinding = item.keybinding;
if (!keybinding) {
@@ -665,9 +665,5 @@ export class SimpleLayoutService implements ILayoutService {
return this._container;
}
get hasWorkbench(): boolean {
return false;
}
constructor(private _container: HTMLElement) { }
}

View File

@@ -202,7 +202,12 @@ export class DynamicStandaloneServices extends Disposable {
let contextViewService = ensure(IContextViewService, () => this._register(new ContextViewService(layoutService)));
ensure(IContextMenuService, () => this._register(new ContextMenuService(layoutService, telemetryService, notificationService, contextViewService, keybindingService, themeService)));
ensure(IContextMenuService, () => {
const contextMenuService = new ContextMenuService(telemetryService, notificationService, contextViewService, keybindingService, themeService);
contextMenuService.configure({ blockMouse: false }); // we do not want that in the standalone editor
return this._register(contextMenuService);
});
ensure(IMenuService, () => new MenuService(commandService));