mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 02:32:35 -05:00
Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 (#15681)
* Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 * Fixes and cleanup * Distro * Fix hygiene yarn * delete no yarn lock changes file * Fix hygiene * Fix layer check * Fix CI * Skip lib checks * Remove tests deleted in vs code * Fix tests * Distro * Fix tests and add removed extension point * Skip failing notebook tests for now * Disable broken tests and cleanup build folder * Update yarn.lock and fix smoke tests * Bump sqlite * fix contributed actions and file spacing * Fix user data path * Update yarn.locks Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IWindowSettings, IWindowOpenable, IOpenWindowOptions, isFolderToOpen, isWorkspaceToOpen, isFileToOpen, IOpenEmptyWindowOptions, IPathData, IFileToOpen } from 'vs/platform/windows/common/windows';
|
||||
import { pathsToEditors } from 'vs/workbench/common/editor';
|
||||
import { whenTextEditorClosed } from 'vs/workbench/browser/editor';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { IModifierKeyStatus, ModifierKeyEmitter, trackFocus } from 'vs/base/browser/dom';
|
||||
@@ -26,6 +27,9 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { BeforeShutdownEvent, ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { getWorkspaceIdentifier } from 'vs/workbench/services/workspaces/browser/workspaces';
|
||||
import { localize } from 'vs/nls';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
|
||||
/**
|
||||
* A workspace to open in the workbench can either be:
|
||||
@@ -47,6 +51,11 @@ export interface IWorkspaceProvider {
|
||||
*/
|
||||
readonly payload?: object;
|
||||
|
||||
/**
|
||||
* Return `true` if the provided [workspace](#IWorkspaceProvider.workspace) is trusted, `false` if not trusted, `undefined` if unknown.
|
||||
*/
|
||||
readonly trusted: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Asks to open a workspace in the current or a new window.
|
||||
*
|
||||
@@ -56,8 +65,10 @@ export interface IWorkspaceProvider {
|
||||
* - `payload`: arbitrary payload that should be made available
|
||||
* to the opening window via the `IWorkspaceProvider.payload` property.
|
||||
* @param payload optional payload to send to the workspace to open.
|
||||
*
|
||||
* @returns true if successfully opened, false otherwise.
|
||||
*/
|
||||
open(workspace: IWorkspace, options?: { reuse?: boolean, payload?: object }): Promise<void>;
|
||||
open(workspace: IWorkspace, options?: { reuse?: boolean, payload?: object }): Promise<boolean>;
|
||||
}
|
||||
|
||||
enum HostShutdownReason {
|
||||
@@ -94,7 +105,8 @@ export class BrowserHostService extends Disposable implements IHostService {
|
||||
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@ILifecycleService private readonly lifecycleService: ILifecycleService,
|
||||
@ILogService private readonly logService: ILogService
|
||||
@ILogService private readonly logService: ILogService,
|
||||
@IDialogService private readonly dialogService: IDialogService
|
||||
) {
|
||||
super();
|
||||
|
||||
@@ -103,7 +115,8 @@ export class BrowserHostService extends Disposable implements IHostService {
|
||||
} else {
|
||||
this.workspaceProvider = new class implements IWorkspaceProvider {
|
||||
readonly workspace = undefined;
|
||||
async open() { }
|
||||
readonly trusted = undefined;
|
||||
async open() { return true; }
|
||||
};
|
||||
}
|
||||
|
||||
@@ -301,8 +314,8 @@ export class BrowserHostService extends Disposable implements IHostService {
|
||||
if (waitMarkerFileURI) {
|
||||
(async () => {
|
||||
|
||||
// Wait for the resources to be closed in the editor...
|
||||
await editorService.whenClosed(fileOpenables.map(openable => ({ resource: openable.fileUri })), { waitForSaved: true });
|
||||
// Wait for the resources to be closed in the text editor...
|
||||
await this.instantiationService.invokeFunction(accessor => whenTextEditorClosed(accessor, fileOpenables.map(fileOpenable => fileOpenable.fileUri)));
|
||||
|
||||
// ...before deleting the wait marker file
|
||||
await this.fileService.del(waitMarkerFileURI);
|
||||
@@ -365,7 +378,7 @@ export class BrowserHostService extends Disposable implements IHostService {
|
||||
return this.doOpen(undefined, { reuse: options?.forceReuseWindow });
|
||||
}
|
||||
|
||||
private doOpen(workspace: IWorkspace, options?: { reuse?: boolean, payload?: object }): Promise<void> {
|
||||
private async doOpen(workspace: IWorkspace, options?: { reuse?: boolean, payload?: object }): Promise<void> {
|
||||
|
||||
// We know that `workspaceProvider.open` will trigger a shutdown
|
||||
// with `options.reuse` so we update `shutdownReason` to reflect that
|
||||
@@ -373,7 +386,13 @@ export class BrowserHostService extends Disposable implements IHostService {
|
||||
this.shutdownReason = HostShutdownReason.Api;
|
||||
}
|
||||
|
||||
return this.workspaceProvider.open(workspace, options);
|
||||
const opened = await this.workspaceProvider.open(workspace, options);
|
||||
if (!opened) {
|
||||
const showResult = await this.dialogService.show(Severity.Warning, localize('unableToOpenExternal', "The browser interrupted the opening of a new tab or window. Press 'Open' to open it anyway."), [localize('open', "Open"), localize('cancel', "Cancel")], { cancelId: 2 });
|
||||
if (showResult.choice === 0) {
|
||||
await this.workspaceProvider.open(workspace, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async toggleFullScreen(): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user