mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -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:
@@ -29,7 +29,7 @@ suite('Breadcrumb Model', function () {
|
||||
|
||||
test('only uri, inside workspace', function () {
|
||||
|
||||
let model = new EditorBreadcrumbsModel(URI.parse('foo:/bar/baz/ws/some/path/file.ts'), undefined, workspaceService, configService);
|
||||
let model = new EditorBreadcrumbsModel(URI.parse('foo:/bar/baz/ws/some/path/file.ts'), undefined, configService, workspaceService);
|
||||
let elements = model.getElements();
|
||||
|
||||
assert.equal(elements.length, 3);
|
||||
@@ -44,7 +44,7 @@ suite('Breadcrumb Model', function () {
|
||||
|
||||
test('only uri, outside workspace', function () {
|
||||
|
||||
let model = new EditorBreadcrumbsModel(URI.parse('foo:/outside/file.ts'), undefined, workspaceService, configService);
|
||||
let model = new EditorBreadcrumbsModel(URI.parse('foo:/outside/file.ts'), undefined, configService, workspaceService);
|
||||
let elements = model.getElements();
|
||||
|
||||
assert.equal(elements.length, 2);
|
||||
|
||||
@@ -112,7 +112,7 @@ class TestFileEditorInput extends EditorInput implements IFileEditorInput {
|
||||
getTypeId() { return 'testFileEditorInputForGroups'; }
|
||||
resolve(): Promise<IEditorModel> { return Promise.resolve(null!); }
|
||||
setEncoding(encoding: string) { }
|
||||
getEncoding(): string { return null!; }
|
||||
getEncoding() { return undefined; }
|
||||
setPreferredEncoding(encoding: string) { }
|
||||
getResource(): URI { return this.resource; }
|
||||
setForceOpenAsBinary(): void { }
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import * as assert from 'assert';
|
||||
import { NotificationsModel, NotificationViewItem, INotificationChangeEvent, NotificationChangeType, NotificationViewItemLabelKind, IStatusMessageChangeEvent, StatusMessageChangeType } from 'vs/workbench/common/notifications';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { INotification, Severity } from 'vs/platform/notification/common/notification';
|
||||
import { INotification, Severity, NotificationsFilter } from 'vs/platform/notification/common/notification';
|
||||
import { createErrorWithActions } from 'vs/base/common/errorsWithActions';
|
||||
|
||||
suite('Notifications', () => {
|
||||
@@ -127,6 +127,19 @@ suite('Notifications', () => {
|
||||
assert.equal(links[2].title, 'Click to execute command \'without.title\'');
|
||||
assert.equal(links[2].length, '[Link 3](command:without.title)'.length);
|
||||
assert.equal(links[2].offset, 'Unable to [Link 1](http://link1.com) open [Link 2](command:open.me "Open This") and '.length);
|
||||
|
||||
// Filter
|
||||
let item8 = NotificationViewItem.create({ severity: Severity.Error, message: 'Error Message' }, NotificationsFilter.SILENT)!;
|
||||
assert.equal(item8.silent, true);
|
||||
|
||||
let item9 = NotificationViewItem.create({ severity: Severity.Error, message: 'Error Message' }, NotificationsFilter.OFF)!;
|
||||
assert.equal(item9.silent, false);
|
||||
|
||||
let item10 = NotificationViewItem.create({ severity: Severity.Error, message: 'Error Message' }, NotificationsFilter.ERROR)!;
|
||||
assert.equal(item10.silent, false);
|
||||
|
||||
let item11 = NotificationViewItem.create({ severity: Severity.Warning, message: 'Error Message' }, NotificationsFilter.ERROR)!;
|
||||
assert.equal(item11.silent, true);
|
||||
});
|
||||
|
||||
test('Model', () => {
|
||||
|
||||
@@ -878,12 +878,12 @@ suite('ExtHostLanguageFeatureCommands', function () {
|
||||
|
||||
let incoming = await commands.executeCommand<vscode.CallHierarchyIncomingCall[]>('vscode.executeCallHierarchyProviderIncomingCalls', model.uri, new types.Position(0, 10));
|
||||
assert.equal(incoming.length, 1);
|
||||
assert.ok(incoming[0].source instanceof types.CallHierarchyItem);
|
||||
assert.equal(incoming[0].source.name, 'IN');
|
||||
assert.ok(incoming[0].from instanceof types.CallHierarchyItem);
|
||||
assert.equal(incoming[0].from.name, 'IN');
|
||||
|
||||
let outgoing = await commands.executeCommand<vscode.CallHierarchyOutgoingCall[]>('vscode.executeCallHierarchyProviderOutgoingCalls', model.uri, new types.Position(0, 10));
|
||||
assert.equal(outgoing.length, 1);
|
||||
assert.ok(outgoing[0].target instanceof types.CallHierarchyItem);
|
||||
assert.equal(outgoing[0].target.name, 'OUT');
|
||||
assert.ok(outgoing[0].to instanceof types.CallHierarchyItem);
|
||||
assert.equal(outgoing[0].to.name, 'OUT');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitData
|
||||
suite('ExtHostConfiguration', function () {
|
||||
|
||||
class RecordingShape extends mock<MainThreadConfigurationShape>() {
|
||||
lastArgs: [ConfigurationTarget, string, any];
|
||||
lastArgs!: [ConfigurationTarget, string, any];
|
||||
$updateConfigurationOption(target: ConfigurationTarget, key: string, value: any): Promise<void> {
|
||||
this.lastArgs = [target, key, value];
|
||||
return Promise.resolve(undefined);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import * as assert from 'assert';
|
||||
import { MainThreadMessageService } from 'vs/workbench/api/browser/mainThreadMessageService';
|
||||
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { INotificationService, INotification, NoOpNotification, INotificationHandle, Severity, IPromptChoice, IPromptOptions, IStatusMessageOptions } from 'vs/platform/notification/common/notification';
|
||||
import { INotificationService, INotification, NoOpNotification, INotificationHandle, Severity, IPromptChoice, IPromptOptions, IStatusMessageOptions, NotificationsFilter } from 'vs/platform/notification/common/notification';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { mock } from 'vs/workbench/test/electron-browser/api/mock';
|
||||
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
|
||||
@@ -55,6 +55,9 @@ const emptyNotificationService = new class implements INotificationService {
|
||||
status(message: string | Error, options?: IStatusMessageOptions): IDisposable {
|
||||
return Disposable.None;
|
||||
}
|
||||
setFilter(filter: NotificationsFilter): void {
|
||||
throw new Error('not implemented.');
|
||||
}
|
||||
};
|
||||
|
||||
class EmptyNotificationService implements INotificationService {
|
||||
@@ -78,11 +81,14 @@ class EmptyNotificationService implements INotificationService {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle {
|
||||
throw new Error('not implemented');
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
status(message: string, options?: IStatusMessageOptions): IDisposable {
|
||||
return Disposable.None;
|
||||
}
|
||||
setFilter(filter: NotificationsFilter): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
|
||||
suite('ExtHostMessageService', function () {
|
||||
|
||||
@@ -28,7 +28,7 @@ const disposables = new DisposableStore();
|
||||
|
||||
let mockMainThreadSearch: MockMainThreadSearch;
|
||||
class MockMainThreadSearch implements MainThreadSearchShape {
|
||||
lastHandle: number;
|
||||
lastHandle!: number;
|
||||
|
||||
results: Array<UriComponents | IRawFileMatch2> = [];
|
||||
|
||||
|
||||
@@ -7,9 +7,10 @@
|
||||
import * as assert from 'assert';
|
||||
import { MarkdownString, LogLevel } from 'vs/workbench/api/common/extHostTypeConverters';
|
||||
import { isEmptyObject } from 'vs/base/common/types';
|
||||
import { size } from 'vs/base/common/collections';
|
||||
import { size, forEach } from 'vs/base/common/collections';
|
||||
import * as types from 'vs/workbench/api/common/extHostTypes';
|
||||
import { LogLevel as _MainLogLevel } from 'vs/platform/log/common/log';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
suite('ExtHostTypeConverter', function () {
|
||||
|
||||
@@ -21,11 +22,13 @@ suite('ExtHostTypeConverter', function () {
|
||||
|
||||
data = MarkdownString.from('Hello [link](foo)');
|
||||
assert.equal(data.value, 'Hello [link](foo)');
|
||||
assert.equal(isEmptyObject(data.uris), true); // no scheme, no uri
|
||||
assert.equal(size(data.uris!), 1);
|
||||
assert.ok(!!data.uris!['foo']);
|
||||
|
||||
data = MarkdownString.from('Hello [link](www.noscheme.bad)');
|
||||
assert.equal(data.value, 'Hello [link](www.noscheme.bad)');
|
||||
assert.equal(isEmptyObject(data.uris), true); // no scheme, no uri
|
||||
assert.equal(size(data.uris!), 1);
|
||||
assert.ok(!!data.uris!['www.noscheme.bad']);
|
||||
|
||||
data = MarkdownString.from('Hello [link](foo:path)');
|
||||
assert.equal(data.value, 'Hello [link](foo:path)');
|
||||
@@ -59,6 +62,20 @@ suite('ExtHostTypeConverter', function () {
|
||||
assert.ok(!!data.uris!['file:///somepath/here2']);
|
||||
});
|
||||
|
||||
test('NPM script explorer running a script from the hover does not work #65561', function () {
|
||||
|
||||
let data = MarkdownString.from('*hello* [click](command:npm.runScriptFromHover?%7B%22documentUri%22%3A%7B%22%24mid%22%3A1%2C%22external%22%3A%22file%3A%2F%2F%2Fc%253A%2Ffoo%2Fbaz.ex%22%2C%22path%22%3A%22%2Fc%3A%2Ffoo%2Fbaz.ex%22%2C%22scheme%22%3A%22file%22%7D%2C%22script%22%3A%22dev%22%7D)');
|
||||
// assert that both uri get extracted but that the latter is only decoded once...
|
||||
assert.equal(size(data.uris!), 2);
|
||||
forEach(data.uris!, entry => {
|
||||
if (entry.value.scheme === 'file') {
|
||||
assert.ok(URI.revive(entry.value).toString().indexOf('file:///c%3A') === 0);
|
||||
} else {
|
||||
assert.equal(entry.value.scheme, 'command');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('LogLevel', () => {
|
||||
assert.equal(LogLevel.from(types.LogLevel.Error), _MainLogLevel.Error);
|
||||
assert.equal(LogLevel.from(types.LogLevel.Info), _MainLogLevel.Info);
|
||||
|
||||
@@ -11,6 +11,7 @@ import * as vscode from 'vscode';
|
||||
import { SingleProxyRPCProtocol } from './testRPCProtocol';
|
||||
import { EditorViewColumn } from 'vs/workbench/api/common/shared/editor';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||
|
||||
suite('ExtHostWebview', () => {
|
||||
|
||||
@@ -22,7 +23,7 @@ suite('ExtHostWebview', () => {
|
||||
webviewCspSource: '',
|
||||
webviewResourceRoot: '',
|
||||
isExtensionDevelopmentDebug: false,
|
||||
});
|
||||
}, undefined);
|
||||
|
||||
let lastInvokedDeserializer: vscode.WebviewPanelSerializer | undefined = undefined;
|
||||
|
||||
@@ -32,21 +33,23 @@ suite('ExtHostWebview', () => {
|
||||
}
|
||||
}
|
||||
|
||||
const extension = {} as IExtensionDescription;
|
||||
|
||||
const serializerA = new NoopSerializer();
|
||||
const serializerB = new NoopSerializer();
|
||||
|
||||
const serializerARegistration = extHostWebviews.registerWebviewPanelSerializer(viewType, serializerA);
|
||||
const serializerARegistration = extHostWebviews.registerWebviewPanelSerializer(extension, viewType, serializerA);
|
||||
|
||||
await extHostWebviews.$deserializeWebviewPanel('x', viewType, 'title', {}, 0 as EditorViewColumn, {});
|
||||
assert.strictEqual(lastInvokedDeserializer, serializerA);
|
||||
|
||||
assert.throws(
|
||||
() => extHostWebviews.registerWebviewPanelSerializer(viewType, serializerB),
|
||||
() => extHostWebviews.registerWebviewPanelSerializer(extension, viewType, serializerB),
|
||||
'Should throw when registering two serializers for the same view');
|
||||
|
||||
serializerARegistration.dispose();
|
||||
|
||||
extHostWebviews.registerWebviewPanelSerializer(viewType, serializerB);
|
||||
extHostWebviews.registerWebviewPanelSerializer(extension, viewType, serializerB);
|
||||
|
||||
await extHostWebviews.$deserializeWebviewPanel('x', viewType, 'title', {}, 0 as EditorViewColumn, {});
|
||||
assert.strictEqual(lastInvokedDeserializer, serializerB);
|
||||
@@ -58,7 +61,7 @@ suite('ExtHostWebview', () => {
|
||||
webviewCspSource: '',
|
||||
webviewResourceRoot: 'vscode-resource://{{resource}}',
|
||||
isExtensionDevelopmentDebug: false,
|
||||
});
|
||||
}, undefined);
|
||||
const webview = extHostWebviews.createWebviewPanel({} as any, 'type', 'title', 1, {});
|
||||
|
||||
assert.strictEqual(
|
||||
@@ -99,7 +102,7 @@ suite('ExtHostWebview', () => {
|
||||
webviewCspSource: '',
|
||||
webviewResourceRoot: `https://{{uuid}}.webview.contoso.com/commit/{{resource}}`,
|
||||
isExtensionDevelopmentDebug: false,
|
||||
});
|
||||
}, undefined);
|
||||
const webview = extHostWebviews.createWebviewPanel({} as any, 'type', 'title', 1, {});
|
||||
|
||||
function stripEndpointUuid(input: string) {
|
||||
|
||||
@@ -79,7 +79,7 @@ suite('MainThreadDocumentsAndEditors', () => {
|
||||
onDidPanelOpen = Event.None;
|
||||
onDidPanelClose = Event.None;
|
||||
getActivePanel() {
|
||||
return null;
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
TestEnvironmentService
|
||||
|
||||
@@ -111,7 +111,7 @@ suite('MainThreadEditors', () => {
|
||||
onDidPanelOpen = Event.None;
|
||||
onDidPanelClose = Event.None;
|
||||
getActivePanel() {
|
||||
return null;
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
TestEnvironmentService
|
||||
|
||||
@@ -87,10 +87,11 @@ import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { IHostService } from 'vs/workbench/services/host/browser/host';
|
||||
import { IElectronService } from 'vs/platform/electron/node/electron';
|
||||
import { INativeOpenDialogOptions, MessageBoxReturnValue, SaveDialogReturnValue, OpenDialogReturnValue } from 'vs/platform/dialogs/node/dialogs';
|
||||
import { INativeOpenDialogOptions } from 'vs/platform/dialogs/node/dialogs';
|
||||
import { IBackupMainService, IWorkspaceBackupInfo } from 'vs/platform/backup/electron-main/backup';
|
||||
import { IEmptyWindowBackupInfo } from 'vs/platform/backup/node/backup';
|
||||
import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogs';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
|
||||
export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput {
|
||||
return instantiationService.createInstance(FileEditorInput, resource, undefined, undefined);
|
||||
@@ -186,11 +187,11 @@ export class TestContextService implements IWorkspaceContextService {
|
||||
}
|
||||
|
||||
export class TestTextFileService extends NativeTextFileService {
|
||||
public cleanupBackupsBeforeShutdownCalled: boolean;
|
||||
public cleanupBackupsBeforeShutdownCalled!: boolean;
|
||||
|
||||
private promptPath: URI;
|
||||
private confirmResult: ConfirmResult;
|
||||
private resolveTextContentError: FileOperationError | null;
|
||||
private promptPath!: URI;
|
||||
private confirmResult!: ConfirmResult;
|
||||
private resolveTextContentError!: FileOperationError | null;
|
||||
|
||||
constructor(
|
||||
@IWorkspaceContextService contextService: IWorkspaceContextService,
|
||||
@@ -461,15 +462,11 @@ export class TestLayoutService implements IWorkbenchLayoutService {
|
||||
onCenteredLayoutChange: Event<boolean> = Event.None;
|
||||
onFullscreenChange: Event<boolean> = Event.None;
|
||||
onPanelPositionChange: Event<string> = Event.None;
|
||||
onPartVisibilityChange: Event<void> = Event.None;
|
||||
onLayout = Event.None;
|
||||
|
||||
private readonly _onTitleBarVisibilityChange = new Emitter<void>();
|
||||
private readonly _onMenubarVisibilityChange = new Emitter<Dimension>();
|
||||
|
||||
public get onTitleBarVisibilityChange(): Event<void> {
|
||||
return this._onTitleBarVisibilityChange.event;
|
||||
}
|
||||
|
||||
public get onMenubarVisibilityChange(): Event<Dimension> {
|
||||
return this._onMenubarVisibilityChange.event;
|
||||
}
|
||||
@@ -582,8 +579,8 @@ export class TestViewletService implements IViewletService {
|
||||
onDidViewletOpen = this.onDidViewletOpenEmitter.event;
|
||||
onDidViewletClose = this.onDidViewletCloseEmitter.event;
|
||||
|
||||
public openViewlet(id: string, focus?: boolean): Promise<IViewlet> {
|
||||
return Promise.resolve(null!);
|
||||
public openViewlet(id: string, focus?: boolean): Promise<IViewlet | undefined> {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
public getViewlets(): ViewletDescriptor[] {
|
||||
@@ -610,7 +607,7 @@ export class TestViewletService implements IViewletService {
|
||||
}
|
||||
|
||||
public getProgressIndicator(id: string) {
|
||||
return null!;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public hideActiveViewlet(): void { }
|
||||
@@ -626,19 +623,19 @@ export class TestPanelService implements IPanelService {
|
||||
onDidPanelOpen = new Emitter<{ panel: IPanel, focus: boolean }>().event;
|
||||
onDidPanelClose = new Emitter<IPanel>().event;
|
||||
|
||||
public openPanel(id: string, focus?: boolean): IPanel {
|
||||
return null!;
|
||||
public openPanel(id: string, focus?: boolean): undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public getPanel(id: string): any {
|
||||
return activeViewlet;
|
||||
}
|
||||
|
||||
public getPanels(): any[] {
|
||||
public getPanels() {
|
||||
return [];
|
||||
}
|
||||
|
||||
public getPinnedPanels(): any[] {
|
||||
public getPinnedPanels() {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -700,14 +697,8 @@ export class TestEditorGroupsService implements IEditorGroupsService {
|
||||
return this.groups;
|
||||
}
|
||||
|
||||
getGroup(identifier: number): IEditorGroup {
|
||||
for (const group of this.groups) {
|
||||
if (group.id === identifier) {
|
||||
return group;
|
||||
}
|
||||
}
|
||||
|
||||
return undefined!;
|
||||
getGroup(identifier: number): IEditorGroup | undefined {
|
||||
return find(this.groups, group => group.id === identifier);
|
||||
}
|
||||
|
||||
getLabel(_identifier: number): string {
|
||||
@@ -762,7 +753,7 @@ export class TestEditorGroupsService implements IEditorGroupsService {
|
||||
return false;
|
||||
}
|
||||
|
||||
partOptions: IEditorPartOptions;
|
||||
partOptions!: IEditorPartOptions;
|
||||
enforcePartOptions(options: IEditorPartOptions): IDisposable {
|
||||
return Disposable.None;
|
||||
}
|
||||
@@ -773,20 +764,20 @@ export class TestEditorGroup implements IEditorGroupView {
|
||||
constructor(public id: number) { }
|
||||
|
||||
get group(): EditorGroup { throw new Error('not implemented'); }
|
||||
activeControl: IVisibleEditor;
|
||||
activeEditor: IEditorInput;
|
||||
previewEditor: IEditorInput;
|
||||
count: number;
|
||||
disposed: boolean;
|
||||
activeControl!: IVisibleEditor;
|
||||
activeEditor!: IEditorInput;
|
||||
previewEditor!: IEditorInput;
|
||||
count!: number;
|
||||
disposed!: boolean;
|
||||
editors: ReadonlyArray<IEditorInput> = [];
|
||||
label: string;
|
||||
index: number;
|
||||
label!: string;
|
||||
index!: number;
|
||||
whenRestored: Promise<void> = Promise.resolve(undefined);
|
||||
element: HTMLElement;
|
||||
minimumWidth: number;
|
||||
maximumWidth: number;
|
||||
minimumHeight: number;
|
||||
maximumHeight: number;
|
||||
element!: HTMLElement;
|
||||
minimumWidth!: number;
|
||||
maximumWidth!: number;
|
||||
minimumHeight!: number;
|
||||
maximumHeight!: number;
|
||||
|
||||
isEmpty = true;
|
||||
isMinimized = false;
|
||||
@@ -877,9 +868,9 @@ export class TestEditorService implements EditorServiceImpl {
|
||||
onDidCloseEditor: Event<IEditorCloseEvent> = Event.None;
|
||||
onDidOpenEditorFail: Event<IEditorIdentifier> = Event.None;
|
||||
|
||||
activeControl: IVisibleEditor;
|
||||
activeControl!: IVisibleEditor;
|
||||
activeTextEditorWidget: any;
|
||||
activeEditor: IEditorInput;
|
||||
activeEditor!: IEditorInput;
|
||||
editors: ReadonlyArray<IEditorInput> = [];
|
||||
visibleControls: ReadonlyArray<IVisibleEditor> = [];
|
||||
visibleTextEditorWidgets = [];
|
||||
@@ -929,7 +920,7 @@ export class TestFileService implements IFileService {
|
||||
readonly onError: Event<Error> = Event.None;
|
||||
|
||||
private content = 'Hello Html';
|
||||
private lastReadFileUri: URI;
|
||||
private lastReadFileUri!: URI;
|
||||
|
||||
constructor() {
|
||||
this._onFileChanges = new Emitter<FileChangesEvent>();
|
||||
@@ -1170,22 +1161,22 @@ export class TestCodeEditorService implements ICodeEditorService {
|
||||
addDiffEditor(_editor: IDiffEditor): void { }
|
||||
removeDiffEditor(_editor: IDiffEditor): void { }
|
||||
listDiffEditors(): IDiffEditor[] { return []; }
|
||||
getFocusedCodeEditor(): ICodeEditor | undefined { return undefined; }
|
||||
getFocusedCodeEditor(): ICodeEditor | null { return null; }
|
||||
registerDecorationType(_key: string, _options: IDecorationRenderOptions, _parentTypeKey?: string): void { }
|
||||
removeDecorationType(_key: string): void { }
|
||||
resolveDecorationOptions(_typeKey: string, _writable: boolean): IModelDecorationOptions { return Object.create(null); }
|
||||
setTransientModelProperty(_model: ITextModel, _key: string, _value: any): void { }
|
||||
getTransientModelProperty(_model: ITextModel, _key: string) { }
|
||||
getActiveCodeEditor(): ICodeEditor | undefined { return undefined; }
|
||||
openCodeEditor(_input: IResourceInput, _source: ICodeEditor, _sideBySide?: boolean): Promise<ICodeEditor | undefined> { return Promise.resolve(undefined); }
|
||||
getActiveCodeEditor(): ICodeEditor | null { return null; }
|
||||
openCodeEditor(_input: IResourceInput, _source: ICodeEditor, _sideBySide?: boolean): Promise<ICodeEditor | null> { return Promise.resolve(null); }
|
||||
}
|
||||
|
||||
export class TestLifecycleService implements ILifecycleService {
|
||||
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
public phase: LifecyclePhase;
|
||||
public startupKind: StartupKind;
|
||||
public phase!: LifecyclePhase;
|
||||
public startupKind!: StartupKind;
|
||||
|
||||
private readonly _onBeforeShutdown = new Emitter<BeforeShutdownEvent>();
|
||||
private readonly _onWillShutdown = new Emitter<WillShutdownEvent>();
|
||||
@@ -1246,12 +1237,10 @@ export class TestTextResourcePropertiesService implements ITextResourcePropertie
|
||||
) {
|
||||
}
|
||||
|
||||
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';
|
||||
}
|
||||
@@ -1317,7 +1306,6 @@ export class TestHostService implements IHostService {
|
||||
|
||||
async restart(): Promise<void> { }
|
||||
async reload(): Promise<void> { }
|
||||
async closeWorkspace(): Promise<void> { }
|
||||
|
||||
async focus(): Promise<void> { }
|
||||
|
||||
@@ -1355,9 +1343,9 @@ export class TestElectronService implements IElectronService {
|
||||
async minimizeWindow(): Promise<void> { }
|
||||
async isWindowFocused(): Promise<boolean> { return true; }
|
||||
async focusWindow(options?: { windowId?: number | undefined; } | undefined): Promise<void> { }
|
||||
async showMessageBox(options: Electron.MessageBoxOptions): Promise<MessageBoxReturnValue> { throw new Error('Method not implemented.'); }
|
||||
async showSaveDialog(options: Electron.SaveDialogOptions): Promise<SaveDialogReturnValue> { throw new Error('Method not implemented.'); }
|
||||
async showOpenDialog(options: Electron.OpenDialogOptions): Promise<OpenDialogReturnValue> { throw new Error('Method not implemented.'); }
|
||||
async showMessageBox(options: Electron.MessageBoxOptions): Promise<Electron.MessageBoxReturnValue> { throw new Error('Method not implemented.'); }
|
||||
async showSaveDialog(options: Electron.SaveDialogOptions): Promise<Electron.SaveDialogReturnValue> { throw new Error('Method not implemented.'); }
|
||||
async showOpenDialog(options: Electron.OpenDialogOptions): Promise<Electron.OpenDialogReturnValue> { throw new Error('Method not implemented.'); }
|
||||
async pickFileFolderAndOpen(options: INativeOpenDialogOptions): Promise<void> { }
|
||||
async pickFileAndOpen(options: INativeOpenDialogOptions): Promise<void> { }
|
||||
async pickFolderAndOpen(options: INativeOpenDialogOptions): Promise<void> { }
|
||||
@@ -1375,14 +1363,13 @@ export class TestElectronService implements IElectronService {
|
||||
async toggleWindowTabsBar(): Promise<void> { }
|
||||
async relaunch(options?: { addArgs?: string[] | undefined; removeArgs?: string[] | undefined; } | undefined): Promise<void> { }
|
||||
async reload(): Promise<void> { }
|
||||
async closeWorkspace(): Promise<void> { }
|
||||
async closeWindow(): Promise<void> { }
|
||||
async quit(): Promise<void> { }
|
||||
async openDevTools(options?: Electron.OpenDevToolsOptions | undefined): Promise<void> { }
|
||||
async toggleDevTools(): Promise<void> { }
|
||||
async startCrashReporter(options: Electron.CrashReporterStartOptions): Promise<void> { }
|
||||
async resolveProxy(url: string): Promise<string | undefined> { return undefined; }
|
||||
async openExtensionDevelopmentHostWindow(args: minimist.ParsedArgs, env: IProcessEnvironment): Promise<void> { }
|
||||
async openExtensionDevelopmentHostWindow(args: string[], env: IProcessEnvironment): Promise<void> { }
|
||||
}
|
||||
|
||||
export class TestBackupMainService implements IBackupMainService {
|
||||
@@ -1448,15 +1435,15 @@ export class TestDialogMainService implements IDialogMainService {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
showMessageBox(options: Electron.MessageBoxOptions, window?: Electron.BrowserWindow | undefined): Promise<MessageBoxReturnValue> {
|
||||
showMessageBox(options: Electron.MessageBoxOptions, window?: Electron.BrowserWindow | undefined): Promise<Electron.MessageBoxReturnValue> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
showSaveDialog(options: Electron.SaveDialogOptions, window?: Electron.BrowserWindow | undefined): Promise<SaveDialogReturnValue> {
|
||||
showSaveDialog(options: Electron.SaveDialogOptions, window?: Electron.BrowserWindow | undefined): Promise<Electron.SaveDialogReturnValue> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
showOpenDialog(options: Electron.OpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise<OpenDialogReturnValue> {
|
||||
showOpenDialog(options: Electron.OpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise<Electron.OpenDialogReturnValue> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user