mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode cfc1ab4c5f816765b91fb7ead3c3427a7c8581a3
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./accessibilityHelp';
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';
|
||||
import { renderFormattedText } from 'vs/base/browser/formattedTextRenderer';
|
||||
@@ -330,7 +329,7 @@ class ShowAccessibilityHelpAction extends EditorAction {
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: (browser.isIE ? KeyMod.CtrlCmd | KeyCode.F1 : KeyMod.Alt | KeyCode.F1),
|
||||
primary: KeyMod.Alt | KeyCode.F1,
|
||||
weight: KeybindingWeight.EditorContrib
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { AbstractGotoLineQuickAccessProvider } from 'vs/editor/contrib/quickAccess/gotoLine';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IQuickAccessRegistry, Extensions } from 'vs/platform/quickinput/common/quickAccess';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
import { GoToLineNLS } from 'vs/editor/common/standaloneStrings';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
|
||||
export class StandaloneGotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProvider {
|
||||
|
||||
readonly onDidActiveTextEditorControlChange = Event.None;
|
||||
|
||||
constructor(@ICodeEditorService private readonly editorService: ICodeEditorService) {
|
||||
super();
|
||||
}
|
||||
|
||||
get activeTextEditorControl() {
|
||||
return withNullAsUndefined(this.editorService.getFocusedCodeEditor());
|
||||
}
|
||||
}
|
||||
|
||||
Registry.as<IQuickAccessRegistry>(Extensions.Quickaccess).registerQuickAccessProvider({
|
||||
ctor: StandaloneGotoLineQuickAccessProvider,
|
||||
prefix: AbstractGotoLineQuickAccessProvider.PREFIX,
|
||||
helpEntries: [{ description: GoToLineNLS.gotoLineActionLabel, needsEditor: true }]
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IQuickAccessRegistry, Extensions } from 'vs/platform/quickinput/common/quickAccess';
|
||||
import { QuickHelpNLS } from 'vs/editor/common/standaloneStrings';
|
||||
import { HelpQuickAccessProvider } from 'vs/platform/quickinput/browser/helpQuickAccess';
|
||||
|
||||
Registry.as<IQuickAccessRegistry>(Extensions.Quickaccess).defaultProvider = {
|
||||
ctor: HelpQuickAccessProvider,
|
||||
prefix: '',
|
||||
helpEntries: [{ description: QuickHelpNLS.helpQuickAccessActionLabel, needsEditor: true }]
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
.quick-input-widget {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.quick-input-widget .monaco-highlighted-label .highlight,
|
||||
.quick-input-widget .monaco-highlighted-label .highlight {
|
||||
color: #0066BF;
|
||||
}
|
||||
|
||||
.vs-dark .quick-input-widget .monaco-highlighted-label .highlight,
|
||||
.vs-dark .quick-input-widget .monaco-highlighted-label .highlight {
|
||||
color: #0097fb;
|
||||
}
|
||||
|
||||
.hc-black .quick-input-widget .monaco-highlighted-label .highlight,
|
||||
.hc-black .quick-input-widget .monaco-highlighted-label .highlight {
|
||||
color: #F38518;
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./standaloneQuickInput';
|
||||
import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser';
|
||||
import { registerEditorContribution } from 'vs/editor/browser/editorExtensions';
|
||||
import { IEditorContribution } from 'vs/editor/common/editorCommon';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IQuickInputService, IQuickInputButton, IQuickPickItem, IQuickPick, IInputBox, IQuickNavigateConfiguration, IPickOptions, QuickPickInput, IInputOptions } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { QuickInputController } from 'vs/base/parts/quickinput/browser/quickInput';
|
||||
import { QuickInputService, IQuickInputControllerHost } from 'vs/platform/quickinput/browser/quickInput';
|
||||
import { once } from 'vs/base/common/functional';
|
||||
import { IQuickAccessController } from 'vs/platform/quickinput/common/quickAccess';
|
||||
|
||||
export class EditorScopedQuickInputServiceImpl extends QuickInputService {
|
||||
|
||||
private host: IQuickInputControllerHost | undefined = undefined;
|
||||
|
||||
constructor(
|
||||
editor: ICodeEditor,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IAccessibilityService accessibilityService: IAccessibilityService,
|
||||
@ILayoutService layoutService: ILayoutService
|
||||
) {
|
||||
super(instantiationService, contextKeyService, themeService, accessibilityService, layoutService);
|
||||
|
||||
// Use the passed in code editor as host for the quick input widget
|
||||
const contribution = QuickInputEditorContribution.get(editor);
|
||||
this.host = {
|
||||
_serviceBrand: undefined,
|
||||
get container() { return contribution.widget.getDomNode(); },
|
||||
get dimension() { return editor.getLayoutInfo(); },
|
||||
get onLayout() { return editor.onDidLayoutChange; },
|
||||
focus: () => editor.focus()
|
||||
};
|
||||
}
|
||||
|
||||
protected createController(): QuickInputController {
|
||||
return super.createController(this.host);
|
||||
}
|
||||
}
|
||||
|
||||
export class StandaloneQuickInputServiceImpl implements IQuickInputService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private mapEditorToService = new Map<ICodeEditor, EditorScopedQuickInputServiceImpl>();
|
||||
private get activeService(): IQuickInputService {
|
||||
const editor = this.codeEditorService.getFocusedCodeEditor();
|
||||
if (!editor) {
|
||||
throw new Error('Quick input service needs a focused editor to work.');
|
||||
}
|
||||
|
||||
// Find the quick input implementation for the focused
|
||||
// editor or create it lazily if not yet created
|
||||
let quickInputService = this.mapEditorToService.get(editor);
|
||||
if (!quickInputService) {
|
||||
const newQuickInputService = quickInputService = this.instantiationService.createInstance(EditorScopedQuickInputServiceImpl, editor);
|
||||
this.mapEditorToService.set(editor, quickInputService);
|
||||
|
||||
once(editor.onDidDispose)(() => {
|
||||
newQuickInputService.dispose();
|
||||
this.mapEditorToService.delete(editor);
|
||||
});
|
||||
}
|
||||
|
||||
return quickInputService;
|
||||
}
|
||||
|
||||
get quickAccess(): IQuickAccessController { return this.activeService.quickAccess; }
|
||||
|
||||
get backButton(): IQuickInputButton { return this.activeService.backButton; }
|
||||
|
||||
get onShow() { return this.activeService.onShow; }
|
||||
get onHide() { return this.activeService.onHide; }
|
||||
|
||||
constructor(
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@ICodeEditorService private readonly codeEditorService: ICodeEditorService
|
||||
) {
|
||||
}
|
||||
|
||||
pick<T extends IQuickPickItem, O extends IPickOptions<T>>(picks: Promise<QuickPickInput<T>[]> | QuickPickInput<T>[], options: O = <O>{}, token: CancellationToken = CancellationToken.None): Promise<O extends { canPickMany: true } ? T[] : T> {
|
||||
return (this.activeService as unknown as QuickInputController /* TS fail */).pick(picks, options, token);
|
||||
}
|
||||
|
||||
input(options?: IInputOptions | undefined, token?: CancellationToken | undefined): Promise<string> {
|
||||
return this.activeService.input(options, token);
|
||||
}
|
||||
|
||||
createQuickPick<T extends IQuickPickItem>(): IQuickPick<T> {
|
||||
return this.activeService.createQuickPick();
|
||||
}
|
||||
|
||||
createInputBox(): IInputBox {
|
||||
return this.activeService.createInputBox();
|
||||
}
|
||||
|
||||
focus(): void {
|
||||
return this.activeService.focus();
|
||||
}
|
||||
|
||||
toggle(): void {
|
||||
return this.activeService.toggle();
|
||||
}
|
||||
|
||||
navigate(next: boolean, quickNavigate?: IQuickNavigateConfiguration | undefined): void {
|
||||
return this.activeService.navigate(next, quickNavigate);
|
||||
}
|
||||
|
||||
accept(): Promise<void> {
|
||||
return this.activeService.accept();
|
||||
}
|
||||
|
||||
back(): Promise<void> {
|
||||
return this.activeService.back();
|
||||
}
|
||||
|
||||
cancel(): Promise<void> {
|
||||
return this.activeService.cancel();
|
||||
}
|
||||
|
||||
hide(focusLost?: boolean | undefined): void {
|
||||
return this.activeService.hide(focusLost);
|
||||
}
|
||||
}
|
||||
|
||||
export class QuickInputEditorContribution implements IEditorContribution {
|
||||
|
||||
static readonly ID = 'editor.controller.quickInput';
|
||||
|
||||
static get(editor: ICodeEditor): QuickInputEditorContribution {
|
||||
return editor.getContribution<QuickInputEditorContribution>(QuickInputEditorContribution.ID);
|
||||
}
|
||||
|
||||
readonly widget = new QuickInputEditorWidget(this.editor);
|
||||
|
||||
constructor(private editor: ICodeEditor) { }
|
||||
|
||||
dispose(): void {
|
||||
this.widget.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
export class QuickInputEditorWidget implements IOverlayWidget {
|
||||
|
||||
private static readonly ID = 'editor.contrib.quickInputWidget';
|
||||
|
||||
private domNode: HTMLElement;
|
||||
|
||||
constructor(private codeEditor: ICodeEditor) {
|
||||
this.domNode = document.createElement('div');
|
||||
|
||||
this.codeEditor.addOverlayWidget(this);
|
||||
}
|
||||
|
||||
getId(): string {
|
||||
return QuickInputEditorWidget.ID;
|
||||
}
|
||||
|
||||
getDomNode(): HTMLElement {
|
||||
return this.domNode;
|
||||
}
|
||||
|
||||
getPosition(): IOverlayWidgetPosition | null {
|
||||
return { preference: OverlayWidgetPositionPreference.TOP_CENTER };
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.codeEditor.removeOverlayWidget(this);
|
||||
}
|
||||
}
|
||||
|
||||
registerEditorContribution(QuickInputEditorContribution.ID, QuickInputEditorContribution);
|
||||
@@ -4,10 +4,9 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { matchesFuzzy } from 'vs/base/common/filters';
|
||||
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { IHighlight, QuickOpenEntryGroup, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel';
|
||||
import { IAutoFocus, Mode, IEntryRunContext } from 'vs/base/parts/quickopen/common/quickOpen';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
@@ -85,7 +84,7 @@ export class QuickCommandAction extends BaseEditorQuickOpenAction {
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: (browser.isIE ? KeyMod.Alt | KeyCode.F1 : KeyCode.F1),
|
||||
primary: KeyCode.F1,
|
||||
weight: KeybindingWeight.EditorContrib
|
||||
},
|
||||
contextMenuOpts: {
|
||||
|
||||
@@ -24,10 +24,10 @@ import { TextEdit, WorkspaceEdit, WorkspaceTextEdit } from 'vs/editor/common/mod
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { IResolvedTextEditorModel, ITextModelContentProvider, ITextModelService } from 'vs/editor/common/services/resolverService';
|
||||
import { ITextResourceConfigurationService, ITextResourcePropertiesService, ITextResourceConfigurationChangeEvent } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { CommandsRegistry, ICommand, ICommandEvent, ICommandHandler, ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { CommandsRegistry, ICommandEvent, ICommandHandler, ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IConfigurationChangeEvent, IConfigurationData, IConfigurationOverrides, IConfigurationService, IConfigurationModel, IConfigurationValue, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
import { Configuration, ConfigurationModel, DefaultConfigurationModel, ConfigurationChangeEvent } from 'vs/platform/configuration/common/configurationModels';
|
||||
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IContextKeyService, ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IConfirmation, IConfirmationResult, IDialogOptions, IDialogService, IShowResult } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { AbstractKeybindingService } from 'vs/platform/keybinding/common/abstractKeybindingService';
|
||||
@@ -36,16 +36,17 @@ import { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingReso
|
||||
import { IKeybindingItem, KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem';
|
||||
import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding';
|
||||
import { ILabelService, ResourceLabelFormatter } from 'vs/platform/label/common/label';
|
||||
import { ILabelService, ResourceLabelFormatter, IFormatterChangeEvent } from 'vs/platform/label/common/label';
|
||||
import { INotification, INotificationHandle, INotificationService, IPromptChoice, IPromptOptions, NoOpNotification, IStatusMessageOptions, NotificationsFilter } from 'vs/platform/notification/common/notification';
|
||||
import { IProgressRunner, IEditorProgressService } from 'vs/platform/progress/common/progress';
|
||||
import { ITelemetryInfo, ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IWorkspace, IWorkspaceContextService, IWorkspaceFolder, IWorkspaceFoldersChangeEvent, WorkbenchState, WorkspaceFolder } from 'vs/platform/workspace/common/workspace';
|
||||
import { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { ILayoutService, IDimension } from 'vs/platform/layout/browser/layoutService';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { SimpleServicesNLS } from 'vs/editor/common/standaloneStrings';
|
||||
import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings';
|
||||
import { basename } from 'vs/base/common/resources';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
|
||||
export class SimpleModel implements IResolvedTextEditorModel {
|
||||
|
||||
@@ -254,7 +255,6 @@ export class StandaloneCommandService implements ICommandService {
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private readonly _instantiationService: IInstantiationService;
|
||||
private readonly _dynamicCommands: { [id: string]: ICommand; };
|
||||
|
||||
private readonly _onWillExecuteCommand = new Emitter<ICommandEvent>();
|
||||
private readonly _onDidExecuteCommand = new Emitter<ICommandEvent>();
|
||||
@@ -263,19 +263,10 @@ export class StandaloneCommandService implements ICommandService {
|
||||
|
||||
constructor(instantiationService: IInstantiationService) {
|
||||
this._instantiationService = instantiationService;
|
||||
this._dynamicCommands = Object.create(null);
|
||||
}
|
||||
|
||||
public addCommand(command: ICommand): IDisposable {
|
||||
const { id } = command;
|
||||
this._dynamicCommands[id] = command;
|
||||
return toDisposable(() => {
|
||||
delete this._dynamicCommands[id];
|
||||
});
|
||||
}
|
||||
|
||||
public executeCommand<T>(id: string, ...args: any[]): Promise<T> {
|
||||
const command = (CommandsRegistry.getCommand(id) || this._dynamicCommands[id]);
|
||||
const command = CommandsRegistry.getCommand(id);
|
||||
if (!command) {
|
||||
return Promise.reject(new Error(`command '${id}' not found`));
|
||||
}
|
||||
@@ -318,7 +309,7 @@ export class StandaloneKeybindingService extends AbstractKeybindingService {
|
||||
}));
|
||||
}
|
||||
|
||||
public addDynamicKeybinding(commandId: string, _keybinding: number, handler: ICommandHandler, when: ContextKeyExpr | undefined): IDisposable {
|
||||
public addDynamicKeybinding(commandId: string, _keybinding: number, handler: ICommandHandler, when: ContextKeyExpression | undefined): IDisposable {
|
||||
const keybinding = createKeybinding(_keybinding, OS);
|
||||
|
||||
const toDispose = new DisposableStore();
|
||||
@@ -344,15 +335,8 @@ export class StandaloneKeybindingService extends AbstractKeybindingService {
|
||||
}));
|
||||
}
|
||||
|
||||
let commandService = this._commandService;
|
||||
if (commandService instanceof StandaloneCommandService) {
|
||||
toDispose.add(commandService.addCommand({
|
||||
id: commandId,
|
||||
handler: handler
|
||||
}));
|
||||
} else {
|
||||
throw new Error('Unknown command service!');
|
||||
}
|
||||
toDispose.add(CommandsRegistry.registerCommand(commandId, handler));
|
||||
|
||||
this.updateResolver({ source: KeybindingSource.Default });
|
||||
|
||||
return toDispose;
|
||||
@@ -713,8 +697,7 @@ export class SimpleUriLabelService implements ILabelService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private readonly _onDidRegisterFormatter = new Emitter<void>();
|
||||
public readonly onDidChangeFormatters: Event<void> = this._onDidRegisterFormatter.event;
|
||||
public readonly onDidChangeFormatters: Event<IFormatterChangeEvent> = Event.None;
|
||||
|
||||
public getUriLabel(resource: URI, options?: { relative?: boolean, forceNoTildify?: boolean }): string {
|
||||
if (resource.scheme === 'file') {
|
||||
@@ -749,8 +732,8 @@ export class SimpleLayoutService implements ILayoutService {
|
||||
|
||||
public onLayout = Event.None;
|
||||
|
||||
private _dimension?: IDimension;
|
||||
get dimension(): IDimension {
|
||||
private _dimension?: dom.IDimension;
|
||||
get dimension(): dom.IDimension {
|
||||
if (!this._dimension) {
|
||||
this._dimension = dom.getClientArea(window.document.body);
|
||||
}
|
||||
@@ -762,5 +745,9 @@ export class SimpleLayoutService implements ILayoutService {
|
||||
return this._container;
|
||||
}
|
||||
|
||||
constructor(private _container: HTMLElement) { }
|
||||
focus(): void {
|
||||
this._codeEditorService.getFocusedCodeEditor()?.focus();
|
||||
}
|
||||
|
||||
constructor(private _codeEditorService: ICodeEditorService, private _container: HTMLElement) { }
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
import * as aria from 'vs/base/browser/ui/aria/aria';
|
||||
import { Disposable, IDisposable, toDisposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';
|
||||
@@ -233,11 +232,7 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon
|
||||
) {
|
||||
options = options || {};
|
||||
options.ariaLabel = options.ariaLabel || StandaloneCodeEditorNLS.editorViewAccessibleLabel;
|
||||
options.ariaLabel = options.ariaLabel + ';' + (
|
||||
browser.isIE
|
||||
? StandaloneCodeEditorNLS.accessibilityHelpMessageIE
|
||||
: StandaloneCodeEditorNLS.accessibilityHelpMessage
|
||||
);
|
||||
options.ariaLabel = options.ariaLabel + ';' + (StandaloneCodeEditorNLS.accessibilityHelpMessage);
|
||||
super(domElement, options, {}, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService);
|
||||
|
||||
if (keybindingService instanceof StandaloneKeybindingService) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { CodeEditorServiceImpl } from 'vs/editor/browser/services/codeEditorServ
|
||||
import { IRange } from 'vs/editor/common/core/range';
|
||||
import { ScrollType } from 'vs/editor/common/editorCommon';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
import { IResourceInput } from 'vs/platform/editor/common/editor';
|
||||
import { IResourceEditorInput } from 'vs/platform/editor/common/editor';
|
||||
|
||||
export class StandaloneCodeEditorServiceImpl extends CodeEditorServiceImpl {
|
||||
|
||||
@@ -19,7 +19,7 @@ export class StandaloneCodeEditorServiceImpl extends CodeEditorServiceImpl {
|
||||
return null; // not supported in the standalone case
|
||||
}
|
||||
|
||||
public openCodeEditor(input: IResourceInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null> {
|
||||
public openCodeEditor(input: IResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null> {
|
||||
if (!source) {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
@@ -27,7 +27,7 @@ export class StandaloneCodeEditorServiceImpl extends CodeEditorServiceImpl {
|
||||
return Promise.resolve(this.doOpenEditor(source, input));
|
||||
}
|
||||
|
||||
private doOpenEditor(editor: ICodeEditor, input: IResourceInput): ICodeEditor | null {
|
||||
private doOpenEditor(editor: ICodeEditor, input: IResourceEditorInput): ICodeEditor | null {
|
||||
const model = this.findModel(editor, input.resource);
|
||||
if (!model) {
|
||||
if (input.resource) {
|
||||
|
||||
@@ -154,7 +154,7 @@ export class TokenizationSupport2Adapter implements modes.ITokenizationSupport {
|
||||
|
||||
private _toBinaryTokens(tokens: IToken[], offsetDelta: number): Uint32Array {
|
||||
const languageId = this._languageIdentifier.id;
|
||||
const tokenTheme = this._standaloneThemeService.getTheme().tokenTheme;
|
||||
const tokenTheme = this._standaloneThemeService.getColorTheme().tokenTheme;
|
||||
|
||||
let result: number[] = [], resultLen = 0;
|
||||
let previousStartIndex: number = 0;
|
||||
|
||||
@@ -52,6 +52,8 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
|
||||
import { BrowserClipboardService } from 'vs/platform/clipboard/browser/clipboardService';
|
||||
import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo';
|
||||
import { UndoRedoService } from 'vs/platform/undoRedo/common/undoRedoService';
|
||||
import { StandaloneQuickInputServiceImpl } from 'vs/editor/standalone/browser/quickInput/standaloneQuickInputServiceImpl';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
|
||||
export interface IEditorOverrideServices {
|
||||
[index: string]: any;
|
||||
@@ -206,7 +208,9 @@ export class DynamicStandaloneServices extends Disposable {
|
||||
|
||||
let keybindingService = ensure(IKeybindingService, () => this._register(new StandaloneKeybindingService(contextKeyService, commandService, telemetryService, notificationService, domElement)));
|
||||
|
||||
let layoutService = ensure(ILayoutService, () => new SimpleLayoutService(domElement));
|
||||
let layoutService = ensure(ILayoutService, () => new SimpleLayoutService(StaticServices.codeEditorService.get(ICodeEditorService), domElement));
|
||||
|
||||
ensure(IQuickInputService, () => new StandaloneQuickInputServiceImpl(_instantiationService, StaticServices.codeEditorService.get(ICodeEditorService)));
|
||||
|
||||
let contextViewService = ensure(IContextViewService, () => this._register(new ContextViewService(layoutService)));
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { hc_black, vs, vs_dark } from 'vs/editor/standalone/common/themes';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { ColorIdentifier, Extensions, IColorRegistry } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { Extensions as ThemingExtensions, ICssStyleCollector, IIconTheme, IThemingRegistry, ITokenStyle } from 'vs/platform/theme/common/themeService';
|
||||
import { Extensions as ThemingExtensions, ICssStyleCollector, IFileIconTheme, IThemingRegistry, ITokenStyle } from 'vs/platform/theme/common/themeService';
|
||||
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
const VS_THEME_NAME = 'vs';
|
||||
@@ -168,11 +168,11 @@ export class StandaloneThemeServiceImpl extends Disposable implements IStandalon
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private readonly _onThemeChange = this._register(new Emitter<IStandaloneTheme>());
|
||||
public readonly onThemeChange = this._onThemeChange.event;
|
||||
private readonly _onColorThemeChange = this._register(new Emitter<IStandaloneTheme>());
|
||||
public readonly onDidColorThemeChange = this._onColorThemeChange.event;
|
||||
|
||||
private readonly _onIconThemeChange = this._register(new Emitter<IIconTheme>());
|
||||
public readonly onIconThemeChange = this._onIconThemeChange.event;
|
||||
private readonly _onFileIconThemeChange = this._register(new Emitter<IFileIconTheme>());
|
||||
public readonly onDidFileIconThemeChange = this._onFileIconThemeChange.event;
|
||||
|
||||
private readonly _environment: IEnvironmentService = Object.create(null);
|
||||
private readonly _knownThemes: Map<string, StandaloneTheme>;
|
||||
@@ -250,7 +250,7 @@ export class StandaloneThemeServiceImpl extends Disposable implements IStandalon
|
||||
}
|
||||
}
|
||||
|
||||
public getTheme(): IStandaloneTheme {
|
||||
public getColorTheme(): IStandaloneTheme {
|
||||
return this._theme;
|
||||
}
|
||||
|
||||
@@ -287,12 +287,12 @@ export class StandaloneThemeServiceImpl extends Disposable implements IStandalon
|
||||
this._styleElements.forEach(styleElement => styleElement.innerHTML = this._css);
|
||||
|
||||
TokenizationRegistry.setColorMap(colorMap);
|
||||
this._onThemeChange.fire(theme);
|
||||
this._onColorThemeChange.fire(theme);
|
||||
|
||||
return theme.id;
|
||||
}
|
||||
|
||||
public getIconTheme(): IIconTheme {
|
||||
public getFileIconTheme(): IFileIconTheme {
|
||||
return {
|
||||
hasFileIcons: false,
|
||||
hasFolderIcons: false,
|
||||
|
||||
@@ -29,7 +29,7 @@ class ToggleHighContrast extends EditorAction {
|
||||
standaloneThemeService.setTheme(this._originalThemeName);
|
||||
this._originalThemeName = null;
|
||||
} else {
|
||||
this._originalThemeName = standaloneThemeService.getTheme().themeName;
|
||||
this._originalThemeName = standaloneThemeService.getColorTheme().themeName;
|
||||
standaloneThemeService.setTheme('hc-black');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user