Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)

* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463

* fix config changes

* fix strictnull checks
This commit is contained in:
Anthony Dresser
2019-09-15 22:38:26 -07:00
committed by GitHub
parent fa6c52699e
commit ea0f9e6ce9
1226 changed files with 21541 additions and 17633 deletions

View File

@@ -31,6 +31,7 @@ import { contrastBorder, editorWidgetBackground, widgetShadow, editorWidgetForeg
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
import { AccessibilityHelpNLS } from 'vs/editor/common/standaloneStrings';
import { EditorOption } from 'vs/editor/common/config/editorOptions';
const CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE = new RawContextKey<boolean>('accessibilityHelpWidgetVisible', false);
@@ -163,7 +164,7 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
if (e.equals(KeyMod.CtrlCmd | KeyCode.KEY_H)) {
alert(AccessibilityHelpNLS.openingDocs);
let url = (<IEditorConstructionOptions>this._editor.getRawConfiguration()).accessibilityHelpUrl;
let url = (<IEditorConstructionOptions>this._editor.getRawOptions()).accessibilityHelpUrl;
if (typeof url === 'undefined') {
url = 'https://go.microsoft.com/fwlink/?linkid=852450';
}
@@ -223,7 +224,7 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
}
private _buildContent() {
let opts = this._editor.getConfiguration();
const options = this._editor.getOptions();
const selections = this._editor.getSelections();
let charactersSelected = 0;
@@ -239,14 +240,14 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
let text = getSelectionLabel(selections, charactersSelected);
if (opts.wrappingInfo.inDiffEditor) {
if (opts.readOnly) {
if (options.get(EditorOption.inDiffEditor)) {
if (options.get(EditorOption.readOnly)) {
text += AccessibilityHelpNLS.readonlyDiffEditor;
} else {
text += AccessibilityHelpNLS.editableDiffEditor;
}
} else {
if (opts.readOnly) {
if (options.get(EditorOption.readOnly)) {
text += AccessibilityHelpNLS.readonlyEditor;
} else {
text += AccessibilityHelpNLS.editableEditor;
@@ -258,7 +259,7 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
? AccessibilityHelpNLS.changeConfigToOnMac
: AccessibilityHelpNLS.changeConfigToOnWinLinux
);
switch (opts.accessibilitySupport) {
switch (options.get(EditorOption.accessibilitySupport)) {
case AccessibilitySupport.Unknown:
text += '\n\n - ' + turnOnMessage;
break;
@@ -272,7 +273,7 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
}
if (opts.tabFocusMode) {
if (options.get(EditorOption.tabFocusMode)) {
text += '\n\n - ' + this._descriptionForCommand(ToggleTabFocusModeAction.ID, AccessibilityHelpNLS.tabFocusModeOnMsg, AccessibilityHelpNLS.tabFocusModeOnMsgNoKb);
} else {
text += '\n\n - ' + this._descriptionForCommand(ToggleTabFocusModeAction.ID, AccessibilityHelpNLS.tabFocusModeOffMsg, AccessibilityHelpNLS.tabFocusModeOffMsgNoKb);

View File

@@ -10,6 +10,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
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 { EditorOption } from 'vs/editor/common/config/editorOptions';
export class IPadShowKeyboard extends Disposable implements IEditorContribution {
@@ -29,7 +30,7 @@ export class IPadShowKeyboard extends Disposable implements IEditorContribution
}
private update(): void {
const shouldHaveWidget = (!this.editor.getConfiguration().readOnly);
const shouldHaveWidget = (!this.editor.getOption(EditorOption.readOnly));
if (!this.widget && shouldHaveWidget) {

View File

@@ -45,10 +45,10 @@ export class QuickOpenEditorWidget implements IOverlayWidget {
onCancel: onCancel,
onType: onType
}, {
inputPlaceHolder: undefined,
inputAriaLabel: configuration.inputAriaLabel,
keyboardSupport: true
}
inputPlaceHolder: undefined,
inputAriaLabel: configuration.inputAriaLabel,
keyboardSupport: true
}
);
this.styler = attachQuickOpenStyler(this.quickOpenWidget, this.themeService, {
pickerGroupForeground: foreground

View File

@@ -28,7 +28,7 @@ import { CommandsRegistry, ICommand, ICommandEvent, ICommandHandler, ICommandSer
import { IConfigurationChangeEvent, IConfigurationData, IConfigurationOverrides, IConfigurationService, IConfigurationModel } from 'vs/platform/configuration/common/configuration';
import { Configuration, ConfigurationModel, DefaultConfigurationModel } from 'vs/platform/configuration/common/configurationModels';
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IConfirmation, IConfirmationResult, IDialogOptions, IDialogService } from 'vs/platform/dialogs/common/dialogs';
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';
import { IKeybindingEvent, IKeyboardEvent, KeybindingSource } from 'vs/platform/keybinding/common/keybinding';
@@ -97,7 +97,7 @@ function withTypedEditor<T>(widget: editorCommon.IEditor, codeEditorCallback: (e
}
export class SimpleEditorModelResolverService implements ITextModelService {
public _serviceBrand: any;
public _serviceBrand: undefined;
private editor?: editorCommon.IEditor;
@@ -142,7 +142,7 @@ export class SimpleEditorModelResolverService implements ITextModelService {
}
export class SimpleEditorProgressService implements IEditorProgressService {
_serviceBrand: any;
_serviceBrand: undefined;
private static NULL_PROGRESS_RUNNER: IProgressRunner = {
done: () => { },
@@ -163,7 +163,7 @@ export class SimpleEditorProgressService implements IEditorProgressService {
export class SimpleDialogService implements IDialogService {
public _serviceBrand: any;
public _serviceBrand: undefined;
public confirm(confirmation: IConfirmation): Promise<IConfirmationResult> {
return this.doConfirm(confirmation).then(confirmed => {
@@ -183,14 +183,14 @@ export class SimpleDialogService implements IDialogService {
return Promise.resolve(window.confirm(messageText));
}
public show(severity: Severity, message: string, buttons: string[], options?: IDialogOptions): Promise<number> {
return Promise.resolve(0);
public show(severity: Severity, message: string, buttons: string[], options?: IDialogOptions): Promise<IShowResult> {
return Promise.resolve({ choice: 0 });
}
}
export class SimpleNotificationService implements INotificationService {
public _serviceBrand: any;
public _serviceBrand: undefined;
private static readonly NO_OP: INotificationHandle = new NoOpNotification();
@@ -232,7 +232,7 @@ export class SimpleNotificationService implements INotificationService {
}
export class StandaloneCommandService implements ICommandService {
_serviceBrand: any;
_serviceBrand: undefined;
private readonly _instantiationService: IInstantiationService;
private readonly _dynamicCommands: { [id: string]: ICommand; };
@@ -414,7 +414,7 @@ function isConfigurationOverrides(thing: any): thing is IConfigurationOverrides
export class SimpleConfigurationService implements IConfigurationService {
_serviceBrand: any;
_serviceBrand: undefined;
private _onDidChangeConfiguration = new Emitter<IConfigurationChangeEvent>();
public readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent> = this._onDidChangeConfiguration.event;
@@ -479,7 +479,7 @@ export class SimpleConfigurationService implements IConfigurationService {
export class SimpleResourceConfigurationService implements ITextResourceConfigurationService {
_serviceBrand: any;
_serviceBrand: undefined;
private readonly _onDidChangeConfiguration = new Emitter<IConfigurationChangeEvent>();
public readonly onDidChangeConfiguration = this._onDidChangeConfiguration.event;
@@ -504,7 +504,7 @@ export class SimpleResourceConfigurationService implements ITextResourceConfigur
export class SimpleResourcePropertiesService implements ITextResourcePropertiesService {
_serviceBrand: any;
_serviceBrand: undefined;
constructor(
@IConfigurationService private readonly configurationService: IConfigurationService,
@@ -523,7 +523,7 @@ export class SimpleResourcePropertiesService implements ITextResourcePropertiesS
}
export class StandaloneTelemetryService implements ITelemetryService {
_serviceBrand: void = undefined;
_serviceBrand: undefined;
public isOptedIn = false;
@@ -545,7 +545,7 @@ export class StandaloneTelemetryService implements ITelemetryService {
export class SimpleWorkspaceContextService implements IWorkspaceContextService {
public _serviceBrand: any;
public _serviceBrand: undefined;
private static SCHEME = 'inmemory';
@@ -614,7 +614,7 @@ export function applyConfigurationValues(configurationService: IConfigurationSer
}
export class SimpleBulkEditService implements IBulkEditService {
_serviceBrand: any;
_serviceBrand: undefined;
constructor(private readonly _modelService: IModelService) {
//
@@ -658,7 +658,7 @@ export class SimpleBulkEditService implements IBulkEditService {
export class SimpleUriLabelService implements ILabelService {
_serviceBrand: any;
_serviceBrand: undefined;
private readonly _onDidRegisterFormatter = new Emitter<void>();
public readonly onDidChangeFormatters: Event<void> = this._onDidRegisterFormatter.event;
@@ -692,7 +692,7 @@ export class SimpleUriLabelService implements ILabelService {
}
export class SimpleLayoutService implements ILayoutService {
_serviceBrand: any;
_serviceBrand: undefined;
public onLayout = Event.None;

View File

@@ -23,7 +23,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { ContextKeyExpr, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IInstantiationService, optional } from 'vs/platform/instantiation/common/instantiation';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { IThemeService } from 'vs/platform/theme/common/themeService';
@@ -376,7 +376,7 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon
@INotificationService notificationService: INotificationService,
@IConfigurationService configurationService: IConfigurationService,
@IContextMenuService contextMenuService: IContextMenuService,
@IClipboardService clipboardService: IClipboardService
@optional(IClipboardService) clipboardService: IClipboardService | null,
) {
applyConfigurationValues(configurationService, options, true);
options = options || {};
@@ -384,7 +384,7 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon
options.theme = themeService.setTheme(options.theme);
}
super(domElement, options, editorWorkerService, contextKeyService, instantiationService, codeEditorService, themeService, notificationService, contextMenuService, clipboardService);
super(domElement, options, clipboardService, editorWorkerService, contextKeyService, instantiationService, codeEditorService, themeService, notificationService, contextMenuService);
this._contextViewService = <ContextViewService>contextViewService;
this._configurationService = configurationService;

View File

@@ -10,7 +10,7 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
import { OpenerService } from 'vs/editor/browser/services/openerService';
import { DiffNavigator } from 'vs/editor/browser/widget/diffNavigator';
import * as editorOptions from 'vs/editor/common/config/editorOptions';
import { ConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions';
import { BareFontInfo, FontInfo } from 'vs/editor/common/config/fontInfo';
import { Token } from 'vs/editor/common/core/token';
import * as editorCommon from 'vs/editor/common/editorCommon';
@@ -38,7 +38,6 @@ 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 { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
@@ -121,7 +120,7 @@ export function createDiffEditor(domElement: HTMLElement, options?: IDiffEditorC
services.get(INotificationService),
services.get(IConfigurationService),
services.get(IContextMenuService),
services.get(IClipboardService)
null
);
});
}
@@ -352,6 +351,7 @@ export function createMonacoEditorAPI(): typeof monaco.editor {
remeasureFonts: remeasureFonts,
// enums
AccessibilitySupport: standaloneEnums.AccessibilitySupport,
ScrollbarVisibility: standaloneEnums.ScrollbarVisibility,
WrappingIndent: standaloneEnums.WrappingIndent,
OverviewRulerLane: standaloneEnums.OverviewRulerLane,
@@ -371,14 +371,14 @@ export function createMonacoEditorAPI(): typeof monaco.editor {
RenderLineNumbersType: standaloneEnums.RenderLineNumbersType,
// classes
InternalEditorOptions: <any>editorOptions.InternalEditorOptions,
ConfigurationChangedEvent: <any>ConfigurationChangedEvent,
BareFontInfo: <any>BareFontInfo,
FontInfo: <any>FontInfo,
TextModelResolvedOptions: <any>TextModelResolvedOptions,
FindMatch: <any>FindMatch,
// vars
EditorType: editorCommon.EditorType
EditorType: editorCommon.EditorType,
};
}

View File

@@ -156,7 +156,7 @@ function newBuiltInTheme(builtinTheme: BuiltinTheme): StandaloneTheme {
export class StandaloneThemeServiceImpl implements IStandaloneThemeService {
_serviceBrand: any;
_serviceBrand: undefined;
private readonly _knownThemes: Map<string, StandaloneTheme>;
private readonly _styleElement: HTMLStyleElement;