More work around isolating node imports (#6512)

* more work around isolating node imports

* rewrite query plan input

* fix hygiene errors

* fix tests

* address feedback

* remove welcome page changes
This commit is contained in:
Anthony Dresser
2019-07-30 14:01:37 -07:00
committed by GitHub
parent c99ce4de07
commit c1acf6ae93
89 changed files with 1430 additions and 1097 deletions

View File

@@ -35,6 +35,7 @@ import { IClipboardService } from 'sql/platform/clipboard/common/clipboardServic
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
class AccountPanel extends ViewletPanel {
public index: number;
@@ -124,7 +125,8 @@ export class AccountDialog extends Modal {
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService private readonly contextKeyService: IContextKeyService,
@IClipboardService clipboardService: IClipboardService,
@ILogService logService: ILogService
@ILogService logService: ILogService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
) {
super(
localize('linkedAccounts', "Linked accounts"),
@@ -134,6 +136,7 @@ export class AccountDialog extends Modal {
clipboardService,
themeService,
logService,
textResourcePropertiesService,
contextKeyService,
{ hasSpinner: true }
);

View File

@@ -6,7 +6,7 @@
import { IExtensionPointUser, ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
import { localize } from 'vs/nls';
import { join } from 'path';
import { join } from 'vs/base/common/path';
import { createCSSRule } from 'vs/base/browser/dom';
import { URI } from 'vs/base/common/uri';

View File

@@ -23,6 +23,7 @@ import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
export class AutoOAuthDialog extends Modal {
private _copyAndOpenButton: Button;
@@ -49,7 +50,8 @@ export class AutoOAuthDialog extends Modal {
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@IClipboardService clipboardService: IClipboardService,
@ILogService logService: ILogService
@ILogService logService: ILogService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
) {
super(
'',
@@ -59,6 +61,7 @@ export class AutoOAuthDialog extends Modal {
clipboardService,
themeService,
logService,
textResourcePropertiesService,
contextKeyService,
{
isFlyout: true,

View File

@@ -29,6 +29,7 @@ import { IAccountPickerService } from 'sql/platform/accounts/common/accountPicke
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
// TODO: Make the help link 1) extensible (01/08/2018, https://github.com/Microsoft/azuredatastudio/issues/450)
// in case that other non-Azure sign in is to be used
@@ -71,7 +72,8 @@ export class FirewallRuleDialog extends Modal {
@IContextKeyService contextKeyService: IContextKeyService,
@IWindowsService private _windowsService: IWindowsService,
@IClipboardService clipboardService: IClipboardService,
@ILogService logService: ILogService
@ILogService logService: ILogService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
) {
super(
localize('createNewFirewallRule', "Create new firewall rule"),
@@ -81,6 +83,7 @@ export class FirewallRuleDialog extends Modal {
clipboardService,
themeService,
logService,
textResourcePropertiesService,
contextKeyService,
{
isFlyout: true,

View File

@@ -86,7 +86,7 @@ function createInstantiationService(addAccountFailureEmitter?: Emitter<string>):
.returns(() => undefined);
// Create a mock account dialog
let accountDialog = new AccountDialog(null, null, instantiationService.object, null, null, null, null, new MockContextKeyService(), null, undefined);
let accountDialog = new AccountDialog(null, null, instantiationService.object, null, null, null, null, new MockContextKeyService(), null, undefined, undefined);
let mockAccountDialog = TypeMoq.Mock.ofInstance(accountDialog);
mockAccountDialog.setup(x => x.onAddAccountErrorEvent)
.returns(() => { return addAccountFailureEmitter ? addAccountFailureEmitter.event : mockEvent.event; });

View File

@@ -37,7 +37,7 @@ suite('auto OAuth dialog controller tests', () => {
mockOnCloseEvent = new Emitter<void>();
// Create a mock auto OAuth dialog
let autoOAuthDialog = new AutoOAuthDialog(null, null, null, null, new MockContextKeyService(), null, undefined);
let autoOAuthDialog = new AutoOAuthDialog(null, null, null, null, new MockContextKeyService(), null, undefined, undefined);
mockAutoOAuthDialog = TypeMoq.Mock.ofInstance(autoOAuthDialog);
mockAutoOAuthDialog.setup(x => x.onCancel).returns(() => mockOnCancelEvent.event);

View File

@@ -60,7 +60,7 @@ suite('Firewall rule dialog controller tests', () => {
.returns(() => mockFirewallRuleViewModel.object);
// Create a mock account picker
let firewallRuleDialog = new FirewallRuleDialog(null, null, null, instantiationService.object, null, null, new MockContextKeyService(), null, null, undefined);
let firewallRuleDialog = new FirewallRuleDialog(null, null, null, instantiationService.object, null, null, new MockContextKeyService(), null, null, undefined, undefined);
mockFirewallRuleDialog = TypeMoq.Mock.ofInstance(firewallRuleDialog);
let mockEvent = new Emitter<any>();

View File

@@ -23,6 +23,7 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { append, $ } from 'vs/base/browser/dom';
import { ILogService } from 'vs/platform/log/common/log';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
export class DialogModal extends Modal {
private _dialogPane: DialogPane;
@@ -43,9 +44,10 @@ export class DialogModal extends Modal {
@IContextKeyService contextKeyService: IContextKeyService,
@IClipboardService clipboardService: IClipboardService,
@ILogService logService: ILogService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService,
@IInstantiationService private _instantiationService: IInstantiationService
) {
super(_dialog.title, name, telemetryService, layoutService, clipboardService, themeService, logService, contextKeyService, options);
super(_dialog.title, name, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, options);
}
public layout(): void {

View File

@@ -24,6 +24,7 @@ import { append, $ } from 'vs/base/browser/dom';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
export class WizardModal extends Modal {
private _dialogPanes = new Map<WizardPage, DialogPane>();
@@ -53,9 +54,10 @@ export class WizardModal extends Modal {
@IContextKeyService contextKeyService: IContextKeyService,
@IInstantiationService private _instantiationService: IInstantiationService,
@IClipboardService clipboardService: IClipboardService,
@ILogService logService: ILogService
@ILogService logService: ILogService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
) {
super(_wizard.title, name, telemetryService, layoutService, clipboardService, themeService, logService, contextKeyService, options);
super(_wizard.title, name, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, options);
this._useDefaultMessageBoxLocation = false;
}

View File

@@ -0,0 +1,34 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Registry } from 'vs/platform/registry/common/platform';
export const Extensions = {
CellComponentContributions: 'notebook.contributions.cells'
};
export interface ICellComponenetRegistry {
registerComponent(component: any): void;
getComponents(): Array<any>;
}
class CellComponenetRegistry implements ICellComponenetRegistry {
private components = new Array<any>();
registerComponent(component: any): void {
this.components.push(component);
}
getComponents(): any[] {
return this.components.slice();
}
}
const componentRegistry = new CellComponenetRegistry();
Registry.add(Extensions.CellComponentContributions, componentRegistry);
export function registerCellComponent(component: any): void {
componentRegistry.registerComponent(component);
}

View File

@@ -22,6 +22,8 @@ export const IQueryManagementService = createDecorator<IQueryManagementService>(
export interface IQueryManagementService {
_serviceBrand: any;
onHandlerAdded: Event<string>;
addQueryRequestHandler(queryType: string, runner: IQueryRequestHandler): IDisposable;
isProviderRegistered(providerId: string): boolean;
getRegisteredProviders(): string[];

View File

@@ -6,13 +6,23 @@
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
import { ScriptOperation } from 'sql/workbench/common/taskUtilities';
import * as azdata from 'azdata';
import { ILogService } from 'vs/platform/log/common/log';
export const SERVICE_ID = 'scriptingService';
export const IScriptingService = createDecorator<IScriptingService>(SERVICE_ID);
export enum ScriptOperation {
Select = 0,
Create = 1,
Insert = 2,
Update = 3,
Delete = 4,
Execute = 5,
Alter = 6
}
export interface IScriptingService {
_serviceBrand: any;