提交 d6b26a56 编写于 作者: B Benjamin Pasero

fix #64596

上级 31b6323e
......@@ -412,9 +412,7 @@ export class CodeApplication extends Disposable {
// Create Electron IPC Server
this.electronIpcServer = new ElectronIPCServer();
// Resolve unique machine ID
this.logService.trace('Resolving machine identifier...');
return this.resolveMachineId().then(machineId => {
const startupWithMachineId = (machineId: string) => {
this.logService.trace(`Resolved machine identifier: ${machineId}`);
// Spawn shared process
......@@ -447,6 +445,28 @@ export class CodeApplication extends Disposable {
this.stopTracingEventually(windows);
}
});
};
// Resolve unique machine ID
this.logService.trace('Resolving machine identifier...');
const resolvedMachineId = this.resolveMachineId();
if (typeof resolvedMachineId === 'string') {
return startupWithMachineId(resolvedMachineId);
} else {
return resolvedMachineId.then(machineId => startupWithMachineId(machineId));
}
}
private resolveMachineId(): string | TPromise<string> {
const machineId = this.stateService.getItem<string>(CodeApplication.MACHINE_ID_KEY);
if (machineId) {
return machineId;
}
return getMachineId().then(machineId => {
this.stateService.setItem(CodeApplication.MACHINE_ID_KEY, machineId);
return machineId;
});
}
......@@ -485,21 +505,6 @@ export class CodeApplication extends Disposable {
});
}
private resolveMachineId(): TPromise<string> {
const machineId = this.stateService.getItem<string>(CodeApplication.MACHINE_ID_KEY);
if (machineId) {
return TPromise.wrap(machineId);
}
return getMachineId().then(machineId => {
// Remember in global storage
this.stateService.setItem(CodeApplication.MACHINE_ID_KEY, machineId);
return machineId;
});
}
private initServices(machineId: string): Thenable<IInstantiationService> {
const services = new ServiceCollection();
......
......@@ -2029,11 +2029,11 @@ class WorkspacesManager {
private isValidTargetWorkspacePath(window: ICodeWindow, path?: string): TPromise<boolean> {
if (!path) {
return TPromise.wrap(true);
return Promise.resolve(true);
}
if (window.openedWorkspace && window.openedWorkspace.configPath === path) {
return TPromise.wrap(false); // window is already opened on a workspace with that path
return Promise.resolve(false); // window is already opened on a workspace with that path
}
// Prevent overwriting a workspace that is currently opened in another window
......@@ -2050,7 +2050,7 @@ class WorkspacesManager {
return this.windowsMainService.showMessageBox(options, this.windowsMainService.getFocusedWindow()).then(() => false);
}
return TPromise.wrap(true); // OK
return Promise.resolve(true); // OK
}
private doSaveAndOpenWorkspace(window: ICodeWindow, workspace: IWorkspaceIdentifier, path?: string): TPromise<IEnterWorkspaceResult> {
......
......@@ -551,18 +551,17 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable
// Catch file URLs
if (uri.authority === Schemas.file && !!uri.path) {
this.openFileForURI(URI.file(uri.fsPath));
return TPromise.as(true);
return Promise.resolve(true);
}
return TPromise.wrap(false);
return Promise.resolve(false);
}
private openFileForURI(uri: URI): TPromise<boolean> {
private openFileForURI(uri: URI): void {
const cli = assign(Object.create(null), this.environmentService.args, { goto: true });
const urisToOpen = [uri];
this.windowsMainService.open({ context: OpenContext.API, cli, urisToOpen });
return TPromise.wrap(true);
}
resolveProxy(windowId: number, url: string): Promise<string | undefined> {
......
......@@ -137,79 +137,79 @@ export class WindowsChannelClient implements IWindowsService {
get onRecentlyOpenedChange(): Event<void> { return this.channel.listen('onRecentlyOpenedChange'); }
pickFileFolderAndOpen(options: INativeOpenDialogOptions): TPromise<void> {
return TPromise.wrap(this.channel.call('pickFileFolderAndOpen', options));
return this.channel.call('pickFileFolderAndOpen', options);
}
pickFileAndOpen(options: INativeOpenDialogOptions): TPromise<void> {
return TPromise.wrap(this.channel.call('pickFileAndOpen', options));
return this.channel.call('pickFileAndOpen', options);
}
pickFolderAndOpen(options: INativeOpenDialogOptions): TPromise<void> {
return TPromise.wrap(this.channel.call('pickFolderAndOpen', options));
return this.channel.call('pickFolderAndOpen', options);
}
pickWorkspaceAndOpen(options: INativeOpenDialogOptions): TPromise<void> {
return TPromise.wrap(this.channel.call('pickWorkspaceAndOpen', options));
return this.channel.call('pickWorkspaceAndOpen', options);
}
showMessageBox(windowId: number, options: MessageBoxOptions): TPromise<IMessageBoxResult> {
return TPromise.wrap(this.channel.call('showMessageBox', [windowId, options]));
return this.channel.call('showMessageBox', [windowId, options]);
}
showSaveDialog(windowId: number, options: SaveDialogOptions): TPromise<string> {
return TPromise.wrap(this.channel.call('showSaveDialog', [windowId, options]));
return this.channel.call('showSaveDialog', [windowId, options]);
}
showOpenDialog(windowId: number, options: OpenDialogOptions): TPromise<string[]> {
return TPromise.wrap(this.channel.call('showOpenDialog', [windowId, options]));
return this.channel.call('showOpenDialog', [windowId, options]);
}
reloadWindow(windowId: number, args?: ParsedArgs): TPromise<void> {
return TPromise.wrap(this.channel.call('reloadWindow', [windowId, args]));
return this.channel.call('reloadWindow', [windowId, args]);
}
openDevTools(windowId: number, options?: IDevToolsOptions): TPromise<void> {
return TPromise.wrap(this.channel.call('openDevTools', [windowId, options]));
return this.channel.call('openDevTools', [windowId, options]);
}
toggleDevTools(windowId: number): TPromise<void> {
return TPromise.wrap(this.channel.call('toggleDevTools', windowId));
return this.channel.call('toggleDevTools', windowId);
}
closeWorkspace(windowId: number): TPromise<void> {
return TPromise.wrap(this.channel.call('closeWorkspace', windowId));
return this.channel.call('closeWorkspace', windowId);
}
enterWorkspace(windowId: number, path: string): TPromise<IEnterWorkspaceResult> {
return TPromise.wrap(this.channel.call('enterWorkspace', [windowId, path]));
return this.channel.call('enterWorkspace', [windowId, path]);
}
createAndEnterWorkspace(windowId: number, folders?: IWorkspaceFolderCreationData[], path?: string): TPromise<IEnterWorkspaceResult> {
return TPromise.wrap(this.channel.call('createAndEnterWorkspace', [windowId, folders, path]));
return this.channel.call('createAndEnterWorkspace', [windowId, folders, path]);
}
saveAndEnterWorkspace(windowId: number, path: string): TPromise<IEnterWorkspaceResult> {
return TPromise.wrap(this.channel.call('saveAndEnterWorkspace', [windowId, path]));
return this.channel.call('saveAndEnterWorkspace', [windowId, path]);
}
toggleFullScreen(windowId: number): TPromise<void> {
return TPromise.wrap(this.channel.call('toggleFullScreen', windowId));
return this.channel.call('toggleFullScreen', windowId);
}
setRepresentedFilename(windowId: number, fileName: string): TPromise<void> {
return TPromise.wrap(this.channel.call('setRepresentedFilename', [windowId, fileName]));
return this.channel.call('setRepresentedFilename', [windowId, fileName]);
}
addRecentlyOpened(files: URI[]): TPromise<void> {
return TPromise.wrap(this.channel.call('addRecentlyOpened', files));
return this.channel.call('addRecentlyOpened', files);
}
removeFromRecentlyOpened(paths: (IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | URI)[]): TPromise<void> {
return TPromise.wrap(this.channel.call('removeFromRecentlyOpened', paths));
return this.channel.call('removeFromRecentlyOpened', paths);
}
clearRecentlyOpened(): TPromise<void> {
return TPromise.wrap(this.channel.call('clearRecentlyOpened'));
return this.channel.call('clearRecentlyOpened');
}
getRecentlyOpened(windowId: number): TPromise<IRecentlyOpened> {
......@@ -222,83 +222,83 @@ export class WindowsChannelClient implements IWindowsService {
}
newWindowTab(): TPromise<void> {
return TPromise.wrap(this.channel.call('newWindowTab'));
return this.channel.call('newWindowTab');
}
showPreviousWindowTab(): TPromise<void> {
return TPromise.wrap(this.channel.call('showPreviousWindowTab'));
return this.channel.call('showPreviousWindowTab');
}
showNextWindowTab(): TPromise<void> {
return TPromise.wrap(this.channel.call('showNextWindowTab'));
return this.channel.call('showNextWindowTab');
}
moveWindowTabToNewWindow(): TPromise<void> {
return TPromise.wrap(this.channel.call('moveWindowTabToNewWindow'));
return this.channel.call('moveWindowTabToNewWindow');
}
mergeAllWindowTabs(): TPromise<void> {
return TPromise.wrap(this.channel.call('mergeAllWindowTabs'));
return this.channel.call('mergeAllWindowTabs');
}
toggleWindowTabsBar(): TPromise<void> {
return TPromise.wrap(this.channel.call('toggleWindowTabsBar'));
return this.channel.call('toggleWindowTabsBar');
}
focusWindow(windowId: number): TPromise<void> {
return TPromise.wrap(this.channel.call('focusWindow', windowId));
return this.channel.call('focusWindow', windowId);
}
closeWindow(windowId: number): TPromise<void> {
return TPromise.wrap(this.channel.call('closeWindow', windowId));
return this.channel.call('closeWindow', windowId);
}
isFocused(windowId: number): TPromise<boolean> {
return TPromise.wrap(this.channel.call('isFocused', windowId));
return this.channel.call('isFocused', windowId);
}
isMaximized(windowId: number): TPromise<boolean> {
return TPromise.wrap(this.channel.call('isMaximized', windowId));
return this.channel.call('isMaximized', windowId);
}
maximizeWindow(windowId: number): TPromise<void> {
return TPromise.wrap(this.channel.call('maximizeWindow', windowId));
return this.channel.call('maximizeWindow', windowId);
}
unmaximizeWindow(windowId: number): TPromise<void> {
return TPromise.wrap(this.channel.call('unmaximizeWindow', windowId));
return this.channel.call('unmaximizeWindow', windowId);
}
minimizeWindow(windowId: number): TPromise<void> {
return TPromise.wrap(this.channel.call('minimizeWindow', windowId));
return this.channel.call('minimizeWindow', windowId);
}
onWindowTitleDoubleClick(windowId: number): TPromise<void> {
return TPromise.wrap(this.channel.call('onWindowTitleDoubleClick', windowId));
return this.channel.call('onWindowTitleDoubleClick', windowId);
}
setDocumentEdited(windowId: number, flag: boolean): TPromise<void> {
return TPromise.wrap(this.channel.call('setDocumentEdited', [windowId, flag]));
return this.channel.call('setDocumentEdited', [windowId, flag]);
}
quit(): TPromise<void> {
return TPromise.wrap(this.channel.call('quit'));
return this.channel.call('quit');
}
relaunch(options: { addArgs?: string[], removeArgs?: string[] }): TPromise<void> {
return TPromise.wrap(this.channel.call('relaunch', [options]));
return this.channel.call('relaunch', [options]);
}
whenSharedProcessReady(): TPromise<void> {
return TPromise.wrap(this.channel.call('whenSharedProcessReady'));
return this.channel.call('whenSharedProcessReady');
}
toggleSharedProcess(): TPromise<void> {
return TPromise.wrap(this.channel.call('toggleSharedProcess'));
return this.channel.call('toggleSharedProcess');
}
openWindow(windowId: number, paths: URI[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean, args?: ParsedArgs }): TPromise<void> {
return TPromise.wrap(this.channel.call('openWindow', [windowId, paths, options]));
return this.channel.call('openWindow', [windowId, paths, options]);
}
openNewWindow(options?: INewWindowOptions): TPromise<void> {
......@@ -306,43 +306,43 @@ export class WindowsChannelClient implements IWindowsService {
}
showWindow(windowId: number): TPromise<void> {
return TPromise.wrap(this.channel.call('showWindow', windowId));
return this.channel.call('showWindow', windowId);
}
getWindows(): TPromise<{ id: number; workspace?: IWorkspaceIdentifier; folderUri?: ISingleFolderWorkspaceIdentifier; title: string; filename?: string; }[]> {
return TPromise.wrap(this.channel.call<{ id: number; workspace?: IWorkspaceIdentifier; folderUri?: ISingleFolderWorkspaceIdentifier; title: string; filename?: string; }[]>('getWindows').then(result => { result.forEach(win => win.folderUri = win.folderUri ? URI.revive(win.folderUri) : win.folderUri); return result; }));
return this.channel.call<{ id: number; workspace?: IWorkspaceIdentifier; folderUri?: ISingleFolderWorkspaceIdentifier; title: string; filename?: string; }[]>('getWindows').then(result => { result.forEach(win => win.folderUri = win.folderUri ? URI.revive(win.folderUri) : win.folderUri); return result; });
}
getWindowCount(): TPromise<number> {
return TPromise.wrap(this.channel.call('getWindowCount'));
return this.channel.call('getWindowCount');
}
log(severity: string, ...messages: string[]): TPromise<void> {
return TPromise.wrap(this.channel.call('log', [severity, messages]));
return this.channel.call('log', [severity, messages]);
}
showItemInFolder(path: string): TPromise<void> {
return TPromise.wrap(this.channel.call('showItemInFolder', path));
return this.channel.call('showItemInFolder', path);
}
getActiveWindowId(): TPromise<number | undefined> {
return TPromise.wrap(this.channel.call('getActiveWindowId'));
return this.channel.call('getActiveWindowId');
}
openExternal(url: string): TPromise<boolean> {
return TPromise.wrap(this.channel.call('openExternal', url));
return this.channel.call('openExternal', url);
}
startCrashReporter(config: CrashReporterStartOptions): TPromise<void> {
return TPromise.wrap(this.channel.call('startCrashReporter', config));
return this.channel.call('startCrashReporter', config);
}
updateTouchBar(windowId: number, items: ISerializableCommandAction[][]): TPromise<void> {
return TPromise.wrap(this.channel.call('updateTouchBar', [windowId, items]));
return this.channel.call('updateTouchBar', [windowId, items]);
}
openAboutDialog(): TPromise<void> {
return TPromise.wrap(this.channel.call('openAboutDialog'));
return this.channel.call('openAboutDialog');
}
resolveProxy(windowId: number, url: string): Promise<string | undefined> {
......
......@@ -46,6 +46,6 @@ export class WorkspacesChannelClient implements IWorkspacesService {
constructor(private channel: IChannel) { }
createWorkspace(folders?: IWorkspaceFolderCreationData[]): TPromise<IWorkspaceIdentifier> {
return TPromise.wrap(this.channel.call('createWorkspace', folders));
return this.channel.call('createWorkspace', folders);
}
}
\ No newline at end of file
......@@ -172,7 +172,7 @@ export class EditorControl extends Disposable {
// Call into editor control
const editorWillChange = !inputMatches;
return TPromise.wrap(control.setInput(editor, options, operation.token)).then(() => {
return control.setInput(editor, options, operation.token).then(() => {
// Focus (unless prevented or another operation is running)
if (operation.isCurrent()) {
......
......@@ -416,21 +416,21 @@ export abstract class EditorInput extends Disposable implements IEditorInput {
* Subclasses should bring up a proper dialog for the user if the editor is dirty and return the result.
*/
confirmSave(): TPromise<ConfirmResult> {
return TPromise.wrap(ConfirmResult.DONT_SAVE);
return Promise.resolve(ConfirmResult.DONT_SAVE);
}
/**
* Saves the editor if it is dirty. Subclasses return a promise with a boolean indicating the success of the operation.
*/
save(): TPromise<boolean> {
return TPromise.as(true);
return Promise.resolve(true);
}
/**
* Reverts the editor if it is dirty. Subclasses return a promise with a boolean indicating the success of the operation.
*/
revert(options?: IRevertOptions): TPromise<boolean> {
return TPromise.as(true);
return Promise.resolve(true);
}
/**
......
......@@ -27,6 +27,7 @@ import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEdi
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { EditorServiceImpl } from 'vs/workbench/browser/parts/editor/editor';
import { CancellationToken } from 'vs/base/common/cancellation';
import { timeout } from 'vs/base/common/async';
export class TestEditorControl extends BaseEditor {
......@@ -393,6 +394,11 @@ suite('Editor service', () => {
visibleEditorChangeEventFired = false;
}
async function closeEditorAndWaitForNextToOpen(group: IEditorGroup, input: EditorInput): Promise<void> {
await group.closeEditor(input);
await timeout(0); // closing an editor will not immediately open the next one, so we need to wait
}
await part.whenRestored;
// 1.) open, open same, open other, close
......@@ -409,11 +415,11 @@ suite('Editor service', () => {
assertActiveEditorChangedEvent(true);
assertVisibleEditorsChangedEvent(true);
await group.closeEditor(otherInput);
await closeEditorAndWaitForNextToOpen(group, otherInput);
assertActiveEditorChangedEvent(true);
assertVisibleEditorsChangedEvent(true);
await group.closeEditor(input);
await closeEditorAndWaitForNextToOpen(group, input);
assertActiveEditorChangedEvent(true);
assertVisibleEditorsChangedEvent(true);
......@@ -426,7 +432,7 @@ suite('Editor service', () => {
assertActiveEditorChangedEvent(false);
assertVisibleEditorsChangedEvent(false);
await group.closeEditor(input);
await closeEditorAndWaitForNextToOpen(group, input);
// 3.) open, open inactive, close
editor = await service.openEditor(input, { pinned: true });
......@@ -450,7 +456,7 @@ suite('Editor service', () => {
assertActiveEditorChangedEvent(false);
assertVisibleEditorsChangedEvent(false);
await group.closeEditor(otherInput);
await closeEditorAndWaitForNextToOpen(group, otherInput);
assertActiveEditorChangedEvent(false);
assertVisibleEditorsChangedEvent(false);
......@@ -492,7 +498,7 @@ suite('Editor service', () => {
assertActiveEditorChangedEvent(true);
assertVisibleEditorsChangedEvent(true);
await rightGroup.closeEditor(otherInput);
await closeEditorAndWaitForNextToOpen(rightGroup, otherInput);
assertActiveEditorChangedEvent(true);
assertVisibleEditorsChangedEvent(true);
......@@ -517,7 +523,7 @@ suite('Editor service', () => {
assertActiveEditorChangedEvent(true);
assertVisibleEditorsChangedEvent(false);
await rightGroup.closeEditor(otherInput);
await closeEditorAndWaitForNextToOpen(rightGroup, otherInput);
assertActiveEditorChangedEvent(false);
assertVisibleEditorsChangedEvent(true);
......@@ -555,7 +561,7 @@ suite('Editor service', () => {
assertActiveEditorChangedEvent(true);
assertVisibleEditorsChangedEvent(true);
await group.closeEditor(input);
await closeEditorAndWaitForNextToOpen(group, input);
assertActiveEditorChangedEvent(false);
assertVisibleEditorsChangedEvent(true);
......
......@@ -20,11 +20,18 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { CancellationToken } from 'vs/base/common/cancellation';
export class TestEditorControl extends BaseEditor {
constructor(@ITelemetryService telemetryService: ITelemetryService) { super('MyFileEditorForEditorGroupService', NullTelemetryService, new TestThemeService(), new TestStorageService()); }
setInput(input: EditorInput, options: EditorOptions, token: CancellationToken): Thenable<void> {
super.setInput(input, options, token);
return input.resolve().then(() => void 0);
}
getId(): string { return 'MyFileEditorForEditorGroupService'; }
layout(): void { }
createEditor(): any { }
......@@ -445,6 +452,7 @@ suite('Editor groups service', () => {
assert.equal(activeEditorChangeCounter, 2);
assert.equal(group.activeEditor, inputInactive);
await group.openEditor(input);
await group.closeEditor(inputInactive);
assert.equal(activeEditorChangeCounter, 3);
......
......@@ -537,7 +537,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer
// Get to target resource
let targetPromise: TPromise<URI>;
if (target) {
targetPromise = TPromise.wrap(target);
targetPromise = Promise.resolve(target);
} else {
let dialogPath = resource;
if (resource.scheme === Schemas.untitled) {
......@@ -728,8 +728,8 @@ export abstract class TextFileService extends Disposable implements ITextFileSer
this._onWillMove.fire({
oldResource: source,
newResource: target,
waitUntil(p: Thenable<any>) {
waitForPromises.push(TPromise.wrap(p).then(undefined, errors.onUnexpectedError));
waitUntil(promise: Thenable<any>) {
waitForPromises.push(promise.then(void 0, errors.onUnexpectedError));
}
});
......
......@@ -75,12 +75,12 @@ export class TextFileService extends AbstractTextFileService {
confirmSave(resources?: URI[]): TPromise<ConfirmResult> {
if (this.environmentService.isExtensionDevelopment) {
return TPromise.wrap(ConfirmResult.DONT_SAVE); // no veto when we are in extension dev mode because we cannot assum we run interactive (e.g. tests)
return Promise.resolve(ConfirmResult.DONT_SAVE); // no veto when we are in extension dev mode because we cannot assum we run interactive (e.g. tests)
}
const resourcesToConfirm = this.getDirty(resources);
if (resourcesToConfirm.length === 0) {
return TPromise.wrap(ConfirmResult.DONT_SAVE);
return Promise.resolve(ConfirmResult.DONT_SAVE);
}
const message = resourcesToConfirm.length === 1 ? nls.localize('saveChangesMessage', "Do you want to save the changes you made to {0}?", paths.basename(resourcesToConfirm[0].fsPath))
......
......@@ -14,11 +14,7 @@ import { toResource } from 'vs/base/test/common/utils';
import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/common/textFileEditorModelManager';
import { FileOperationResult, FileOperationError, IFileService, snapshotToString } from 'vs/platform/files/common/files';
import { IModelService } from 'vs/editor/common/services/modelService';
import { timeout as thenableTimeout } from 'vs/base/common/async';
function timeout(n: number) {
return TPromise.wrap(thenableTimeout(n));
}
import { timeout } from 'vs/base/common/async';
class ServiceAccessor {
constructor(@ITextFileService public textFileService: TestTextFileService, @IModelService public modelService: IModelService, @IFileService public fileService: TestFileService) {
......
......@@ -206,7 +206,7 @@ suite('Files - TextFileService', () => {
const mockedFileUri = untitledUncUri.with({ scheme: Schemas.file });
const mockedEditorInput = instantiationService.createInstance(TextFileEditorModel, mockedFileUri, 'utf8');
const loadOrCreateStub = sinon.stub(accessor.textFileService.models, 'loadOrCreate', () => TPromise.wrap(mockedEditorInput));
const loadOrCreateStub = sinon.stub(accessor.textFileService.models, 'loadOrCreate', () => Promise.resolve(mockedEditorInput));
sinon.stub(accessor.untitledEditorService, 'exists', () => true);
sinon.stub(accessor.untitledEditorService, 'hasAssociatedFilePath', () => true);
......
......@@ -226,11 +226,11 @@ export class TestTextFileService extends TextFileService {
}
public promptForPath(_resource: URI, _defaultPath: URI): TPromise<URI> {
return TPromise.wrap(this.promptPath);
return Promise.resolve(this.promptPath);
}
public confirmSave(_resources?: URI[]): TPromise<ConfirmResult> {
return TPromise.wrap(this.confirmResult);
return Promise.resolve(this.confirmResult);
}
public onFilesConfigurationChange(configuration: any): void {
......@@ -847,14 +847,14 @@ export class TestFileService implements IFileService {
}
updateContent(resource: URI, _value: string | ITextSnapshot, _options?: IUpdateContentOptions): TPromise<IFileStat> {
return TPromise.wrap(timeout(0).then(() => ({
return timeout(0).then(() => ({
resource,
etag: 'index.txt',
encoding: 'utf8',
mtime: Date.now(),
isDirectory: false,
name: paths.basename(resource.fsPath)
})));
}));
}
moveFile(_source: URI, _target: URI, _overwrite?: boolean): TPromise<IFileStat> {
......@@ -1113,15 +1113,15 @@ export class TestWindowService implements IWindowService {
}
showMessageBox(_options: Electron.MessageBoxOptions): TPromise<IMessageBoxResult> {
return TPromise.wrap({ button: 0 });
return Promise.resolve({ button: 0 });
}
showSaveDialog(_options: Electron.SaveDialogOptions): TPromise<string> {
return TPromise.wrap(void 0);
return Promise.resolve(void 0);
}
showOpenDialog(_options: Electron.OpenDialogOptions): TPromise<string[]> {
return TPromise.wrap(void 0);
return Promise.resolve(void 0);
}
updateTouchBar(_items: ISerializableCommandAction[][]): TPromise<void> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册