Refact/idea lastknown (#501)

* close

* connection is working

* formatting

* adds all

* formatting

* removed unneeded logging

* readd npm shrinkwrap

* addressed comments

* fix capabilities cacheing

* updated shrinkwrap

* fixed tests

* remove dead code

* vbump sqltools
This commit is contained in:
Anthony Dresser
2018-01-18 18:03:37 -08:00
committed by GitHub
parent e2efe69b73
commit b33ffafdc0
111 changed files with 3892 additions and 11665 deletions

View File

@@ -136,7 +136,7 @@ export interface IConnectionManagementService {
clearRecentConnectionsList(): void;
clearRecentConnection(connectionProfile: IConnectionProfile) : void;
clearRecentConnection(connectionProfile: IConnectionProfile): void;
getActiveConnections(): ConnectionProfile[];
@@ -278,24 +278,6 @@ export interface IErrorMessageService {
showDialog(severity: Severity, headerTitle: string, message: string, messageDetails?: string, actions?: IAction[]): void;
}
export enum ServiceOptionType {
string = 0,
multistring = 1,
password = 2,
number = 3,
category = 4,
boolean = 5
}
export enum ConnectionOptionSpecialType {
serverName = 0,
databaseName = 1,
authType = 2,
userName = 3,
password = 4,
appName = 5
}
export enum RunQueryOnConnectionMode {
none = 0,
executeQuery = 1,

View File

@@ -52,6 +52,11 @@ export class ConnectionStore {
this._connectionConfig = new ConnectionConfig(this._configurationEditService,
this._workspaceConfigurationService, this._capabilitiesService, cachedServerCapabilities);
}
if (_capabilitiesService) {
_capabilitiesService.onProviderRegisteredEvent(e => {
this.saveCachedServerCapabilities();
});
}
}
public static get CRED_PREFIX(): string { return 'Microsoft.SqlTools'; }

View File

@@ -7,7 +7,7 @@
import data = require('data');
import * as interfaces from 'sql/parts/connection/common/interfaces';
import { ConnectionOptionSpecialType, ServiceOptionType } from 'sql/parts/connection/common/connectionManagement';
import { ConnectionOptionSpecialType, ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
import * as Constants from 'sql/parts/connection/common/constants';
export class ProviderConnectionInfo implements data.ConnectionInfo {
@@ -114,7 +114,7 @@ export class ProviderConnectionInfo implements data.ConnectionInfo {
return isPasswordRequired;
}
private getSpecialTypeOptionValue(type: number): string {
private getSpecialTypeOptionValue(type: string): string {
let name = this.getSpecialTypeOptionName(type);
if (name) {
return this.options[name];
@@ -172,7 +172,7 @@ export class ProviderConnectionInfo implements data.ConnectionInfo {
return providerId;
}
public getSpecialTypeOptionName(type: number): string {
public getSpecialTypeOptionName(type: string): string {
if (this._serverCapabilities) {
let optionMetadata = this._serverCapabilities.connectionProvider.options.find(o => o.specialValueType === type);
return !!optionMetadata ? optionMetadata.name : undefined;
@@ -181,7 +181,7 @@ export class ProviderConnectionInfo implements data.ConnectionInfo {
}
}
public setSpecialTypeOptionName(type: number, value: string): void {
public setSpecialTypeOptionName(type: string, value: string): void {
let name = this.getSpecialTypeOptionName(type);
if (!!name) {
this.options[name] = value;
@@ -238,4 +238,3 @@ export class ProviderConnectionInfo implements data.ConnectionInfo {
return parts;
}
}