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