Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move code around for more linting #8190

Merged
merged 4 commits into from Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -5,7 +5,7 @@

import * as assert from 'assert';

export async function assertThrowsAsync(fn, expectedMessage?: string): Promise<void> {
export async function assertThrowsAsync(fn: () => Promise<any>, expectedMessage?: string): Promise<void> {
let threw = false;
try {
await fn();
Expand Down
File renamed without changes.
Expand Up @@ -6,11 +6,11 @@
import * as azdata from 'azdata';
import * as assert from 'assert';
import * as TypeMoq from 'typemoq';
import { EventVerifierSingle } from 'sqltest/utils/eventVerifier';
import { Emitter } from 'vs/base/common/event';
import { AccountPickerViewModel } from 'sql/platform/accounts/common/accountPickerViewModel';
import { UpdateAccountListEventParams } from 'sql/platform/accounts/common/eventTypes';
import { TestAccountManagementService } from 'sql/platform/accounts/test/common/testAccountManagementService';
import { EventVerifierSingle } from 'sql/base/test/common/event';

// SUITE STATE /////////////////////////////////////////////////////////////
let mockUpdateAccountEmitter: Emitter<UpdateAccountListEventParams>;
Expand Down
2 changes: 1 addition & 1 deletion src/sql/platform/accounts/test/common/accountStore.test.ts
Expand Up @@ -6,7 +6,7 @@
import * as assert from 'assert';
import * as azdata from 'azdata';
import AccountStore from 'sql/platform/accounts/common/accountStore';
import { EventVerifierSingle } from 'sqltest/utils/eventVerifier';
import { EventVerifierSingle } from 'sql/base/test/common/event';

suite('Account Store Tests', () => {
test('AddOrUpdate - Uninitialized memento', done => {
Expand Down
Expand Up @@ -6,11 +6,11 @@
import * as assert from 'assert';
import * as azdata from 'azdata';
import * as TypeMoq from 'typemoq';
import { EventVerifierSingle } from 'sqltest/utils/eventVerifier';
import { Emitter } from 'vs/base/common/event';
import { AccountViewModel } from 'sql/platform/accounts/common/accountViewModel';
import { AccountProviderAddedEventParams, UpdateAccountListEventParams } from 'sql/platform/accounts/common/eventTypes';
import { TestAccountManagementService } from 'sql/platform/accounts/test/common/testAccountManagementService';
import { EventVerifierSingle } from 'sql/base/test/common/event';

// SUITE STATE /////////////////////////////////////////////////////////////
let mockAddProviderEmitter: Emitter<AccountProviderAddedEventParams>;
Expand Down
Expand Up @@ -6,7 +6,7 @@
import { Subject } from 'rxjs/Subject';
import { Subscription } from 'rxjs/Subscription';

import { IAngularEventingService, IAngularEvent, AngularEventType } from 'sql/platform/angularEventing/common/angularEventingService';
import { IAngularEventingService, IAngularEvent, AngularEventType } from 'sql/platform/angularEventing/browser/angularEventingService';
import { ILogService } from 'vs/platform/log/common/log';

export class AngularEventingService implements IAngularEventingService {
Expand Down
8 changes: 6 additions & 2 deletions src/sql/platform/capabilities/common/capabilitiesService.ts
Expand Up @@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/common/connectionProviderExtension';

import * as azdata from 'azdata';

import { Event } from 'vs/base/common/event';
Expand All @@ -19,6 +17,12 @@ export const clientCapabilities = {
hostVersion: HOST_VERSION
};

export interface ConnectionProviderProperties {
providerId: string;
displayName: string;
connectionOptions: azdata.ConnectionOption[];
}

export interface ProviderFeatures {
connection: ConnectionProviderProperties;
}
Expand Down
3 changes: 1 addition & 2 deletions src/sql/platform/connection/common/connectionManagement.ts
Expand Up @@ -10,8 +10,7 @@ import { IConnectionProfileGroup, ConnectionProfileGroup } from 'sql/platform/co
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { ConnectionManagementInfo } from 'sql/platform/connection/common/connectionManagementInfo';
import { IServerGroupDialogCallbacks } from 'sql/platform/serverGroup/common/serverGroupController';
import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/common/connectionProviderExtension';
import { ConnectionProviderProperties } from 'sql/platform/capabilities/common/capabilitiesService';

/**
* Options for the actions that could happen after connecting is complete
Expand Down
3 changes: 1 addition & 2 deletions src/sql/platform/connection/common/providerConnectionInfo.ts
Expand Up @@ -9,8 +9,7 @@ import { isString } from 'vs/base/common/types';
import * as azdata from 'azdata';
import { ConnectionOptionSpecialType, ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
import * as Constants from 'sql/platform/connection/common/constants';
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/common/connectionProviderExtension';
import { ICapabilitiesService, ConnectionProviderProperties } from 'sql/platform/capabilities/common/capabilitiesService';

type SettableProperty = 'serverName' | 'authenticationType' | 'databaseName' | 'password' | 'connectionName' | 'userName';

Expand Down
Expand Up @@ -9,8 +9,8 @@ import * as azdata from 'azdata';
import * as assert from 'assert';
import { ConnectionOptionSpecialType, ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
import { TestCapabilitiesService } from 'sql/platform/capabilities/test/common/testCapabilitiesService';
import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/common/connectionProviderExtension';
import { mssqlProviderName } from 'sql/platform/connection/common/constants';
import { ConnectionProviderProperties } from 'sql/platform/capabilities/common/capabilitiesService';

suite('SQL ConnectionProfileInfo tests', () => {
let msSQLCapabilities: ConnectionProviderProperties;
Expand Down
36 changes: 18 additions & 18 deletions src/sql/platform/connection/test/common/connectionStore.test.ts
Expand Up @@ -12,12 +12,12 @@ import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { TestConfigurationService } from 'sql/platform/connection/test/common/testConfigurationService';
import { TestCredentialsService } from 'sql/platform/credentials/test/common/testCredentialsService';
import { ConnectionOptionSpecialType, ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/common/connectionProviderExtension';
import { TestCapabilitiesService } from 'sql/platform/capabilities/test/common/testCapabilitiesService';
import { deepClone, deepFreeze } from 'vs/base/common/objects';
import { ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
import { TestStorageService } from 'vs/workbench/test/workbenchTestServices';
import { mssqlProviderName } from 'sql/platform/connection/common/constants';
import { ConnectionProviderProperties } from 'sql/platform/capabilities/common/capabilitiesService';
import { InMemoryStorageService } from 'vs/platform/storage/common/storage';

suite('ConnectionStore', () => {
let defaultNamedProfile: IConnectionProfile = deepFreeze({
Expand Down Expand Up @@ -142,7 +142,7 @@ suite('ConnectionStore', () => {
// Given 5 is the max # creds
const numCreds = 6;

const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand All @@ -169,7 +169,7 @@ suite('ConnectionStore', () => {
});

test('getRecentlyUsedConnections should return connection for given provider', () => {
const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();
const connectionStore = new ConnectionStore(storageService, configurationService,
Expand All @@ -181,7 +181,7 @@ suite('ConnectionStore', () => {

test('addActiveConnection should add same connection exactly once', async () => {

const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand All @@ -204,7 +204,7 @@ suite('ConnectionStore', () => {

// Setup credential store to capture credentials sent to it

const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand Down Expand Up @@ -251,7 +251,7 @@ suite('ConnectionStore', () => {
});

test('can clear connections list', async () => {
const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand All @@ -268,7 +268,7 @@ suite('ConnectionStore', () => {
});

test('isPasswordRequired should return true for MSSQL SqlLogin', () => {
const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand All @@ -279,7 +279,7 @@ suite('ConnectionStore', () => {
});

test('isPasswordRequired should return true for MSSQL SqlLogin for connection profile object', () => {
const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand All @@ -291,7 +291,7 @@ suite('ConnectionStore', () => {
});

test('isPasswordRequired should return false if the password is not required in capabilities', () => {
const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand All @@ -318,7 +318,7 @@ suite('ConnectionStore', () => {
});

test('saveProfile should save the password after the profile is saved', async () => {
const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand All @@ -335,7 +335,7 @@ suite('ConnectionStore', () => {
});

test('getGroupFromId returns undefined when there is no group with the given ID', () => {
const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand All @@ -346,7 +346,7 @@ suite('ConnectionStore', () => {
});

test('getGroupFromId returns the group that has the given ID', () => {
const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand Down Expand Up @@ -384,7 +384,7 @@ suite('ConnectionStore', () => {
});

test('getProfileWithoutPassword can return the profile without credentials in the password property or options dictionary', () => {
const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand All @@ -402,7 +402,7 @@ suite('ConnectionStore', () => {
});

test('addPassword gets the password from the credentials service', async () => {
const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand All @@ -422,7 +422,7 @@ suite('ConnectionStore', () => {
});

test('getConnectionProfileGroups', async () => {
const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand Down Expand Up @@ -459,7 +459,7 @@ suite('ConnectionStore', () => {
});

test('removing connection correctly removes', async () => {
const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand All @@ -484,7 +484,7 @@ suite('ConnectionStore', () => {
});

test('getRecentlyUsedConnections correctly fills in group names', async () => {
const storageService = new TestStorageService();
const storageService = new InMemoryStorageService();
const configurationService = new TestConfigurationService();
const credentialsService = new TestCredentialsService();

Expand Down
Expand Up @@ -11,7 +11,7 @@ import { ConnectionProfile } from 'sql/platform/connection/common/connectionProf
import { ConnectionManagementInfo } from 'sql/platform/connection/common/connectionManagementInfo';
import * as azdata from 'azdata';
import { Event, Emitter } from 'vs/base/common/event';
import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/common/connectionProviderExtension';
import { ConnectionProviderProperties } from 'sql/platform/capabilities/common/capabilitiesService';

// Test stubs for commonly used objects

Expand Down
Expand Up @@ -10,10 +10,11 @@ import * as Utils from 'sql/platform/connection/common/utils';
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { TestCapabilitiesService } from 'sql/platform/capabilities/test/common/testCapabilitiesService';
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
import { TestEnvironmentService } from 'vs/workbench/test/workbenchTestServices';
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
import { mssqlProviderName } from 'sql/platform/connection/common/constants';
import { NullLogService } from 'vs/platform/log/common/log';
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv';

let connections: ConnectionStatusManager;
let capabilitiesService: TestCapabilitiesService;
Expand Down Expand Up @@ -78,7 +79,9 @@ suite('SQL ConnectionStatusManager tests', () => {
setup(() => {
capabilitiesService = new TestCapabilitiesService();
connectionProfileObject = new ConnectionProfile(capabilitiesService, connectionProfile);
connections = new ConnectionStatusManager(capabilitiesService, new NullLogService(), TestEnvironmentService, new TestNotificationService());

const environmentService = new EnvironmentService(parseArgs(process.argv, OPTIONS), process.execPath);
connections = new ConnectionStatusManager(capabilitiesService, new NullLogService(), environmentService, new TestNotificationService());
connection1Id = Utils.generateUri(connectionProfile);
connection2Id = 'connection2Id';
connection3Id = 'connection3Id';
Expand Down
Expand Up @@ -14,7 +14,6 @@ import { IConnectionManagementService } from 'sql/platform/connection/common/con
import { Event, Emitter } from 'vs/base/common/event';
import { Disposable } from 'vs/base/common/lifecycle';
import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';
import { IConfigurationChangedEvent } from 'sql/workbench/parts/profiler/browser/profilerFindWidget';

/**
* Service that collects the results of executed queries
Expand Down
4 changes: 2 additions & 2 deletions src/sql/workbench/api/browser/mainThreadModelViewDialog.ts
Expand Up @@ -9,8 +9,8 @@ import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';

import { MainThreadModelViewDialogShape, SqlMainContext, ExtHostModelViewDialogShape, SqlExtHostContext } from 'sql/workbench/api/common/sqlExtHost.protocol';
import { Dialog, DialogTab, DialogButton, WizardPage, Wizard } from 'sql/platform/dialog/common/dialogTypes';
import { CustomDialogService } from 'sql/platform/dialog/browser/customDialogService';
import { Dialog, DialogTab, DialogButton, WizardPage, Wizard } from 'sql/workbench/services/dialog/common/dialogTypes';
import { CustomDialogService } from 'sql/workbench/services/dialog/browser/customDialogService';
import { IModelViewDialogDetails, IModelViewTabDetails, IModelViewButtonDetails, IModelViewWizardPageDetails, IModelViewWizardDetails } from 'sql/workbench/api/common/sqlExtHostTypes';
import { ModelViewInput, ModelViewInputModel, ModeViewSaveHandler } from 'sql/workbench/browser/modelComponents/modelViewInput';

Expand Down
2 changes: 1 addition & 1 deletion src/sql/workbench/browser/actions.ts
Expand Up @@ -5,7 +5,7 @@

import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { IAngularEventingService, AngularEventType } from 'sql/platform/angularEventing/common/angularEventingService';
import { IAngularEventingService, AngularEventType } from 'sql/platform/angularEventing/browser/angularEventingService';
import { IInsightsDialogService } from 'sql/workbench/services/insights/browser/insightsDialogService';
import { Task } from 'sql/platform/tasks/browser/tasksRegistry';

Expand Down
Expand Up @@ -13,7 +13,7 @@ import * as azdata from 'azdata';
import { ComponentBase } from 'sql/workbench/browser/modelComponents/componentBase';
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/workbench/browser/modelComponents/interfaces';
import { Checkbox, ICheckboxOptions } from 'sql/base/browser/ui/checkbox/checkbox';
import { CommonServiceInterface } from 'sql/platform/bootstrap/browser/commonServiceInterface.service';
import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
import { attachCheckboxStyler } from 'sql/platform/theme/common/styler';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';

Expand Down
Expand Up @@ -13,7 +13,7 @@ import { IComponent, IComponentDescriptor, IModelStore } from 'sql/workbench/bro
import { FormLayout, FormItemLayout } from 'azdata';

import { ContainerBase } from 'sql/workbench/browser/modelComponents/componentBase';
import { CommonServiceInterface } from 'sql/platform/bootstrap/browser/commonServiceInterface.service';
import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';

export interface TitledFormItemLayout {
title: string;
Expand Down
Expand Up @@ -19,10 +19,10 @@ import { Registry } from 'vs/platform/registry/common/platform';
import { memoize } from 'vs/base/common/decorators';
import { generateUuid } from 'vs/base/common/uuid';
import { Event } from 'vs/base/common/event';
import { LayoutRequestParams } from 'sql/platform/dialog/browser/dialogContainer.component';
import { LayoutRequestParams } from 'sql/workbench/services/dialog/browser/dialogContainer.component';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
import { ILogService } from 'vs/platform/log/common/log';
import { IBootstrapParams } from 'sql/platform/bootstrap/common/bootstrapParams';
import { IBootstrapParams } from 'sql/workbench/services/bootstrap/common/bootstrapParams';

const componentRegistry = <IComponentRegistry>Registry.as(Extensions.ComponentContribution);

Expand Down
Expand Up @@ -10,7 +10,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
import { addDisposableListener, EventType } from 'vs/base/browser/dom';
import { memoize } from 'vs/base/common/decorators';

import { CommonServiceInterface } from 'sql/platform/bootstrap/browser/commonServiceInterface.service';
import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
import { IModelView } from 'sql/platform/model/browser/modelViewService';
import { ViewBase } from 'sql/workbench/browser/modelComponents/viewBase';
import { IModelViewService } from 'sql/platform/modelComponents/browser/modelViewService';
Expand Down