mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)
* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 * fix pipelines * fix strict-null-checks * add missing files
This commit is contained in:
@@ -37,7 +37,7 @@ const CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE = new RawContextKey<boolean>('accessi
|
||||
|
||||
class AccessibilityHelpController extends Disposable
|
||||
implements IEditorContribution {
|
||||
private static readonly ID = 'editor.contrib.accessibilityHelpController';
|
||||
public static readonly ID = 'editor.contrib.accessibilityHelpController';
|
||||
|
||||
public static get(editor: ICodeEditor): AccessibilityHelpController {
|
||||
return editor.getContribution<AccessibilityHelpController>(
|
||||
@@ -60,10 +60,6 @@ class AccessibilityHelpController extends Disposable
|
||||
);
|
||||
}
|
||||
|
||||
public getId(): string {
|
||||
return AccessibilityHelpController.ID;
|
||||
}
|
||||
|
||||
public show(): void {
|
||||
this._widget.show();
|
||||
}
|
||||
@@ -348,7 +344,7 @@ class ShowAccessibilityHelpAction extends EditorAction {
|
||||
}
|
||||
}
|
||||
|
||||
registerEditorContribution(AccessibilityHelpController);
|
||||
registerEditorContribution(AccessibilityHelpController.ID, AccessibilityHelpController);
|
||||
registerEditorAction(ShowAccessibilityHelpAction);
|
||||
|
||||
const AccessibilityHelpCommand = EditorCommand.bindToContribution<AccessibilityHelpController>(AccessibilityHelpController.get);
|
||||
|
||||
@@ -14,7 +14,7 @@ import { EditorOption } from 'vs/editor/common/config/editorOptions';
|
||||
|
||||
export class IPadShowKeyboard extends Disposable implements IEditorContribution {
|
||||
|
||||
private static readonly ID = 'editor.contrib.iPadShowKeyboard';
|
||||
public static readonly ID = 'editor.contrib.iPadShowKeyboard';
|
||||
|
||||
private readonly editor: ICodeEditor;
|
||||
private widget: ShowKeyboardWidget | null;
|
||||
@@ -44,10 +44,6 @@ export class IPadShowKeyboard extends Disposable implements IEditorContribution
|
||||
}
|
||||
}
|
||||
|
||||
public getId(): string {
|
||||
return IPadShowKeyboard.ID;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
super.dispose();
|
||||
if (this.widget) {
|
||||
@@ -103,4 +99,4 @@ class ShowKeyboardWidget extends Disposable implements IOverlayWidget {
|
||||
}
|
||||
}
|
||||
|
||||
registerEditorContribution(IPadShowKeyboard);
|
||||
registerEditorContribution(IPadShowKeyboard.ID, IPadShowKeyboard);
|
||||
|
||||
@@ -25,7 +25,7 @@ import { InspectTokensNLS } from 'vs/editor/common/standaloneStrings';
|
||||
|
||||
class InspectTokensController extends Disposable implements IEditorContribution {
|
||||
|
||||
private static readonly ID = 'editor.contrib.inspectTokens';
|
||||
public static readonly ID = 'editor.contrib.inspectTokens';
|
||||
|
||||
public static get(editor: ICodeEditor): InspectTokensController {
|
||||
return editor.getContribution<InspectTokensController>(InspectTokensController.ID);
|
||||
@@ -50,10 +50,6 @@ class InspectTokensController extends Disposable implements IEditorContribution
|
||||
this._register(TokenizationRegistry.onDidChange((e) => this.stop()));
|
||||
}
|
||||
|
||||
public getId(): string {
|
||||
return InspectTokensController.ID;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.stop();
|
||||
super.dispose();
|
||||
@@ -325,7 +321,7 @@ class InspectTokensWidget extends Disposable implements IContentWidget {
|
||||
}
|
||||
}
|
||||
|
||||
registerEditorContribution(InspectTokensController);
|
||||
registerEditorContribution(InspectTokensController.ID, InspectTokensController);
|
||||
registerEditorAction(InspectTokens);
|
||||
|
||||
registerThemingParticipant((theme, collector) => {
|
||||
|
||||
@@ -24,7 +24,7 @@ export interface IQuickOpenControllerOpts {
|
||||
|
||||
export class QuickOpenController implements editorCommon.IEditorContribution, IDecorator {
|
||||
|
||||
private static readonly ID = 'editor.controller.quickOpenController';
|
||||
public static readonly ID = 'editor.controller.quickOpenController';
|
||||
|
||||
public static get(editor: ICodeEditor): QuickOpenController {
|
||||
return editor.getContribution<QuickOpenController>(QuickOpenController.ID);
|
||||
@@ -39,10 +39,6 @@ export class QuickOpenController implements editorCommon.IEditorContribution, ID
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
public getId(): string {
|
||||
return QuickOpenController.ID;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
// Dispose widget
|
||||
if (this.widget) {
|
||||
@@ -173,4 +169,4 @@ export interface IDecorator {
|
||||
clearDecorations(): void;
|
||||
}
|
||||
|
||||
registerEditorContribution(QuickOpenController);
|
||||
registerEditorContribution(QuickOpenController.ID, QuickOpenController);
|
||||
|
||||
@@ -23,7 +23,7 @@ export class QuickOpenEditorWidget implements IOverlayWidget {
|
||||
|
||||
private readonly codeEditor: ICodeEditor;
|
||||
private readonly themeService: IThemeService;
|
||||
private visible: boolean;
|
||||
private visible: boolean | undefined;
|
||||
private quickOpenWidget: QuickOpenWidget;
|
||||
private domNode: HTMLElement;
|
||||
private styler: IDisposable;
|
||||
@@ -31,11 +31,8 @@ export class QuickOpenEditorWidget implements IOverlayWidget {
|
||||
constructor(codeEditor: ICodeEditor, onOk: () => void, onCancel: () => void, onType: (value: string) => void, configuration: IQuickOpenEditorWidgetOptions, themeService: IThemeService) {
|
||||
this.codeEditor = codeEditor;
|
||||
this.themeService = themeService;
|
||||
this.visible = false;
|
||||
|
||||
this.create(onOk, onCancel, onType, configuration);
|
||||
}
|
||||
|
||||
private create(onOk: () => void, onCancel: () => void, onType: (value: string) => void, configuration: IQuickOpenEditorWidgetOptions): void {
|
||||
this.domNode = document.createElement('div');
|
||||
|
||||
this.quickOpenWidget = new QuickOpenWidget(
|
||||
@@ -58,29 +55,29 @@ export class QuickOpenEditorWidget implements IOverlayWidget {
|
||||
this.codeEditor.addOverlayWidget(this);
|
||||
}
|
||||
|
||||
public setInput(model: QuickOpenModel, focus: IAutoFocus): void {
|
||||
setInput(model: QuickOpenModel, focus: IAutoFocus): void {
|
||||
this.quickOpenWidget.setInput(model, focus);
|
||||
}
|
||||
|
||||
public getId(): string {
|
||||
getId(): string {
|
||||
return QuickOpenEditorWidget.ID;
|
||||
}
|
||||
|
||||
public getDomNode(): HTMLElement {
|
||||
getDomNode(): HTMLElement {
|
||||
return this.domNode;
|
||||
}
|
||||
|
||||
public destroy(): void {
|
||||
destroy(): void {
|
||||
this.codeEditor.removeOverlayWidget(this);
|
||||
this.quickOpenWidget.dispose();
|
||||
this.styler.dispose();
|
||||
}
|
||||
|
||||
public isVisible(): boolean {
|
||||
return this.visible;
|
||||
isVisible(): boolean {
|
||||
return !!this.visible;
|
||||
}
|
||||
|
||||
public show(value: string): void {
|
||||
show(value: string): void {
|
||||
this.visible = true;
|
||||
|
||||
const editorLayout = this.codeEditor.getLayoutInfo();
|
||||
@@ -92,13 +89,13 @@ export class QuickOpenEditorWidget implements IOverlayWidget {
|
||||
this.codeEditor.layoutOverlayWidget(this);
|
||||
}
|
||||
|
||||
public hide(): void {
|
||||
hide(): void {
|
||||
this.visible = false;
|
||||
this.quickOpenWidget.hide();
|
||||
this.codeEditor.layoutOverlayWidget(this);
|
||||
}
|
||||
|
||||
public getPosition(): IOverlayWidgetPosition | null {
|
||||
getPosition(): IOverlayWidgetPosition | null {
|
||||
if (this.visible) {
|
||||
return {
|
||||
preference: OverlayWidgetPositionPreference.TOP_CENTER
|
||||
@@ -107,4 +104,4 @@ export class QuickOpenEditorWidget implements IOverlayWidget {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import { ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editor
|
||||
import { IRange, Range } from 'vs/editor/common/core/range';
|
||||
import { ScrollType } from 'vs/editor/common/editorCommon';
|
||||
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
|
||||
import { DocumentSymbol, DocumentSymbolProviderRegistry, symbolKindToCssClass } from 'vs/editor/common/modes';
|
||||
import { DocumentSymbol, DocumentSymbolProviderRegistry, SymbolKinds } from 'vs/editor/common/modes';
|
||||
import { getDocumentSymbols } from 'vs/editor/contrib/quickOpen/quickOpen';
|
||||
import { BaseEditorQuickOpenAction, IDecorator } from 'vs/editor/standalone/browser/quickOpen/editorQuickOpen';
|
||||
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
@@ -198,7 +198,7 @@ export class QuickOutlineAction extends BaseEditorQuickOpenAction {
|
||||
}
|
||||
|
||||
// Add
|
||||
results.push(this.symbolEntry(label, symbolKindToCssClass(element.kind), description, element.range, highlights, editor, controller));
|
||||
results.push(this.symbolEntry(label, SymbolKinds.toCssClassName(element.kind), description, element.range, highlights, editor, controller));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,4 +37,4 @@ export class StandaloneReferencesController extends ReferencesController {
|
||||
}
|
||||
}
|
||||
|
||||
registerEditorContribution(StandaloneReferencesController);
|
||||
registerEditorContribution(ReferencesController.ID, StandaloneReferencesController);
|
||||
|
||||
@@ -37,7 +37,7 @@ import { IKeybindingItem, KeybindingsRegistry } from 'vs/platform/keybinding/com
|
||||
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 { INotification, INotificationHandle, INotificationService, IPromptChoice, IPromptOptions, NoOpNotification, IStatusMessageOptions } from 'vs/platform/notification/common/notification';
|
||||
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';
|
||||
@@ -233,6 +233,8 @@ export class SimpleNotificationService implements INotificationService {
|
||||
public status(message: string | Error, options?: IStatusMessageOptions): IDisposable {
|
||||
return Disposable.None;
|
||||
}
|
||||
|
||||
public setFilter(filter: NotificationsFilter): void { }
|
||||
}
|
||||
|
||||
export class StandaloneCommandService implements ICommandService {
|
||||
@@ -515,12 +517,10 @@ export class SimpleResourcePropertiesService implements ITextResourcePropertiesS
|
||||
) {
|
||||
}
|
||||
|
||||
getEOL(resource: URI): string {
|
||||
const filesConfiguration = this.configurationService.getValue<{ eol: string }>('files');
|
||||
if (filesConfiguration && filesConfiguration.eol) {
|
||||
if (filesConfiguration.eol !== 'auto') {
|
||||
return filesConfiguration.eol;
|
||||
}
|
||||
getEOL(resource: URI, language?: string): string {
|
||||
const eol = this.configurationService.getValue<string>('files.eol', { overrideIdentifier: language, resource });
|
||||
if (eol && eol !== 'auto') {
|
||||
return eol;
|
||||
}
|
||||
return (isLinux || isMacintosh) ? '\n' : '\r\n';
|
||||
}
|
||||
@@ -551,7 +551,7 @@ export class SimpleWorkspaceContextService implements IWorkspaceContextService {
|
||||
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
private static SCHEME = 'inmemory';
|
||||
private static readonly SCHEME = 'inmemory';
|
||||
|
||||
private readonly _onDidChangeWorkspaceName = new Emitter<void>();
|
||||
public readonly onDidChangeWorkspaceName: Event<void> = this._onDidChangeWorkspaceName.event;
|
||||
|
||||
@@ -30,6 +30,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { StandaloneCodeEditorNLS } from 'vs/editor/common/standaloneStrings';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IEditorProgressService } from 'vs/platform/progress/common/progress';
|
||||
|
||||
/**
|
||||
* Description of an action contribution
|
||||
@@ -376,6 +377,7 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon
|
||||
@INotificationService notificationService: INotificationService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IContextMenuService contextMenuService: IContextMenuService,
|
||||
@IEditorProgressService editorProgressService: IEditorProgressService,
|
||||
@optional(IClipboardService) clipboardService: IClipboardService | null,
|
||||
) {
|
||||
applyConfigurationValues(configurationService, options, true);
|
||||
@@ -384,7 +386,7 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon
|
||||
options.theme = themeService.setTheme(options.theme);
|
||||
}
|
||||
|
||||
super(domElement, options, clipboardService, editorWorkerService, contextKeyService, instantiationService, codeEditorService, themeService, notificationService, contextMenuService);
|
||||
super(domElement, options, clipboardService, editorWorkerService, contextKeyService, instantiationService, codeEditorService, themeService, notificationService, contextMenuService, editorProgressService);
|
||||
|
||||
this._contextViewService = <ContextViewService>contextViewService;
|
||||
this._configurationService = configurationService;
|
||||
|
||||
@@ -15,19 +15,19 @@ import { IResourceInput } from 'vs/platform/editor/common/editor';
|
||||
|
||||
export class StandaloneCodeEditorServiceImpl extends CodeEditorServiceImpl {
|
||||
|
||||
public getActiveCodeEditor(): ICodeEditor | undefined {
|
||||
return undefined; // not supported in the standalone case
|
||||
public getActiveCodeEditor(): ICodeEditor | null {
|
||||
return null; // not supported in the standalone case
|
||||
}
|
||||
|
||||
public openCodeEditor(input: IResourceInput, source: ICodeEditor | undefined, sideBySide?: boolean): Promise<ICodeEditor | undefined> {
|
||||
public openCodeEditor(input: IResourceInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null> {
|
||||
if (!source) {
|
||||
return Promise.resolve(undefined);
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
|
||||
return Promise.resolve(this.doOpenEditor(source, input));
|
||||
}
|
||||
|
||||
private doOpenEditor(editor: ICodeEditor, input: IResourceInput): ICodeEditor | undefined {
|
||||
private doOpenEditor(editor: ICodeEditor, input: IResourceInput): ICodeEditor | null {
|
||||
const model = this.findModel(editor, input.resource);
|
||||
if (!model) {
|
||||
if (input.resource) {
|
||||
@@ -39,7 +39,7 @@ export class StandaloneCodeEditorServiceImpl extends CodeEditorServiceImpl {
|
||||
return editor;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
return null;
|
||||
}
|
||||
|
||||
const selection = <IRange>(input.options ? input.options.selection : null);
|
||||
|
||||
@@ -38,6 +38,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { clearAllFontInfos } from 'vs/editor/browser/config/configuration';
|
||||
import { IEditorProgressService } from 'vs/platform/progress/common/progress';
|
||||
|
||||
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
||||
|
||||
@@ -120,6 +121,7 @@ export function createDiffEditor(domElement: HTMLElement, options?: IDiffEditorC
|
||||
services.get(INotificationService),
|
||||
services.get(IConfigurationService),
|
||||
services.get(IContextMenuService),
|
||||
services.get(IEditorProgressService),
|
||||
null
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user