mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode a234f13c45b40a0929777cb440ee011b7549eed2 (#8911)
* Merge from vscode a234f13c45b40a0929777cb440ee011b7549eed2 * update distro * fix layering * update distro * fix tests
This commit is contained in:
@@ -21,7 +21,7 @@ import * as browser from 'vs/base/browser/browser';
|
||||
import { ICommandService, CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import { IResourceInput } from 'vs/platform/editor/common/editor';
|
||||
import { KeyboardMapperFactory } from 'vs/workbench/services/keybinding/electron-browser/nativeKeymapService';
|
||||
import { ipcRenderer as ipc, webFrame, crashReporter, Event as IpcEvent } from 'electron';
|
||||
import { ipcRenderer as ipc, webFrame, crashReporter, CrashReporterStartOptions, Event as IpcEvent } from 'electron';
|
||||
import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing';
|
||||
import { IMenuService, MenuId, IMenu, MenuItemAction, ICommandAction, SubmenuItemAction, MenuRegistry } from 'vs/platform/actions/common/actions';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
@@ -41,7 +41,6 @@ import { IAccessibilityService, AccessibilitySupport } from 'vs/platform/accessi
|
||||
import { WorkbenchState, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { coalesce } from 'vs/base/common/arrays';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { isEqual } from 'vs/base/common/resources';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { MenubarControl } from '../browser/parts/titlebar/menubarControl';
|
||||
@@ -98,7 +97,6 @@ export class ElectronWindow extends Disposable {
|
||||
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
|
||||
@IAccessibilityService private readonly accessibilityService: IAccessibilityService,
|
||||
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
|
||||
@ITextFileService private readonly textFileService: ITextFileService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@IOpenerService private readonly openerService: IOpenerService,
|
||||
@IElectronService private readonly electronService: IElectronService,
|
||||
@@ -270,7 +268,7 @@ export class ElectronWindow extends Disposable {
|
||||
if (isMacintosh) {
|
||||
this._register(this.workingCopyService.onDidChangeDirty(workingCopy => {
|
||||
const gotDirty = workingCopy.isDirty();
|
||||
if (gotDirty && !!(workingCopy.capabilities & WorkingCopyCapabilities.AutoSave) && this.filesConfigurationService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY) {
|
||||
if (gotDirty && !(workingCopy.capabilities & WorkingCopyCapabilities.Untitled) && this.filesConfigurationService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY) {
|
||||
return; // do not indicate dirty of working copies that are auto saved after short delay
|
||||
}
|
||||
|
||||
@@ -539,13 +537,13 @@ export class ElectronWindow extends Disposable {
|
||||
}
|
||||
|
||||
// base options with product info
|
||||
const options = {
|
||||
const options: CrashReporterStartOptions = {
|
||||
companyName,
|
||||
productName,
|
||||
submitURL: isWindows ? hockeyAppConfig[process.arch === 'ia32' ? 'win32-ia32' : 'win32-x64'] : isLinux ? hockeyAppConfig[`linux-x64`] : hockeyAppConfig.darwin,
|
||||
extra: {
|
||||
vscode_version: product.version,
|
||||
vscode_commit: product.commit
|
||||
vscode_commit: product.commit || ''
|
||||
}
|
||||
};
|
||||
|
||||
@@ -626,7 +624,7 @@ export class ElectronWindow extends Disposable {
|
||||
// to close the editor while the save still continues in the background. As such
|
||||
// we have to also check if the files to wait for are dirty and if so wait
|
||||
// for them to get saved before deleting the wait marker file.
|
||||
const dirtyFilesToWait = this.textFileService.getDirty(resourcesToWaitFor);
|
||||
const dirtyFilesToWait = resourcesToWaitFor.filter(resourceToWaitFor => this.workingCopyService.isDirty(resourceToWaitFor));
|
||||
if (dirtyFilesToWait.length > 0) {
|
||||
await Promise.all(dirtyFilesToWait.map(async dirtyFileToWait => await this.joinResourceSaved(dirtyFileToWait)));
|
||||
}
|
||||
@@ -641,13 +639,13 @@ export class ElectronWindow extends Disposable {
|
||||
|
||||
private joinResourceSaved(resource: URI): Promise<void> {
|
||||
return new Promise(resolve => {
|
||||
if (!this.textFileService.isDirty(resource)) {
|
||||
if (!this.workingCopyService.isDirty(resource)) {
|
||||
return resolve(); // return early if resource is not dirty
|
||||
}
|
||||
|
||||
// Otherwise resolve promise when resource is saved
|
||||
const listener = this.textFileService.models.onModelSaved(e => {
|
||||
if (isEqual(resource, e.resource)) {
|
||||
const listener = this.workingCopyService.onDidChangeDirty(e => {
|
||||
if (!e.isDirty() && isEqual(resource, e.resource)) {
|
||||
listener.dispose();
|
||||
|
||||
resolve();
|
||||
|
||||
Reference in New Issue
Block a user