mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Clean up some of the extensions (#8267)
* 💄
* prune unused code
* more cleanup
* remove abunch of used code
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
/**
|
||||
@@ -30,7 +28,7 @@ export interface Tenant {
|
||||
/**
|
||||
* Represents a resource exposed by an Azure Active Directory
|
||||
*/
|
||||
export interface Resource {
|
||||
interface Resource {
|
||||
/**
|
||||
* Identifier of the resource
|
||||
*/
|
||||
@@ -42,25 +40,10 @@ export interface Resource {
|
||||
endpoint: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the arguments that identify an instantiation of the AAD account provider
|
||||
*/
|
||||
export interface Arguments {
|
||||
/**
|
||||
* Host of the authority
|
||||
*/
|
||||
host: string;
|
||||
|
||||
/**
|
||||
* Identifier of the client application
|
||||
*/
|
||||
clientId: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents settings for an AAD account provider
|
||||
*/
|
||||
export interface Settings {
|
||||
interface Settings {
|
||||
/**
|
||||
* Host of the authority
|
||||
*/
|
||||
@@ -138,7 +121,7 @@ export interface AzureAccountProviderMetadata extends azdata.AccountProviderMeta
|
||||
/**
|
||||
* Properties specific to an Azure account
|
||||
*/
|
||||
export interface AzureAccountProperties {
|
||||
interface AzureAccountProperties {
|
||||
/**
|
||||
* Whether or not the account is a Microsoft account
|
||||
*/
|
||||
@@ -163,7 +146,7 @@ export interface AzureAccount extends azdata.Account {
|
||||
/**
|
||||
* Token returned from a request for an access token
|
||||
*/
|
||||
export interface AzureAccountSecurityToken {
|
||||
interface AzureAccountSecurityToken {
|
||||
/**
|
||||
* Access token, itself
|
||||
*/
|
||||
|
||||
@@ -8,14 +8,14 @@ import { ResourceServiceBase, GraphData } from '../resourceTreeDataProviderBase'
|
||||
import { AzureResourceDatabaseServer } from '../../interfaces';
|
||||
|
||||
|
||||
export interface DbServerGraphData extends GraphData {
|
||||
interface DbServerGraphData extends GraphData {
|
||||
properties: {
|
||||
fullyQualifiedDomainName: string;
|
||||
administratorLogin: string;
|
||||
};
|
||||
}
|
||||
|
||||
export const serversQuery = 'where type == "microsoft.dbforpostgresql/servers"';
|
||||
const serversQuery = 'where type == "microsoft.dbforpostgresql/servers"';
|
||||
|
||||
export class PostgresServerService extends ResourceServiceBase<DbServerGraphData, AzureResourceDatabaseServer> {
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { AzureResourceDatabaseServer } from '../../interfaces';
|
||||
import { ResourceServiceBase, GraphData } from '../resourceTreeDataProviderBase';
|
||||
|
||||
export interface SqlInstanceGraphData extends GraphData {
|
||||
interface SqlInstanceGraphData extends GraphData {
|
||||
properties: {
|
||||
fullyQualifiedDomainName: string;
|
||||
administratorLogin: string;
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { AppContext } from '../../appContext';
|
||||
|
||||
import { TreeNode } from '../treeNode';
|
||||
@@ -12,7 +10,7 @@ import { IAzureResourceTreeChangeHandler } from './treeChangeHandler';
|
||||
import { IAzureResourceCacheService } from '../../azureResource/interfaces';
|
||||
import { AzureResourceServiceNames } from '../constants';
|
||||
|
||||
export abstract class AzureResourceTreeNodeBase extends TreeNode {
|
||||
abstract class AzureResourceTreeNodeBase extends TreeNode {
|
||||
public constructor(
|
||||
public readonly appContext: AppContext,
|
||||
public readonly treeChangeHandler: IAzureResourceTreeChangeHandler,
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export function getErrorMessage(error: Error | string): string {
|
||||
function getErrorMessage(error: Error | string): string {
|
||||
return (error instanceof Error) ? error.message : error;
|
||||
}
|
||||
|
||||
@@ -93,4 +91,4 @@ export function equals(one: any, other: any): boolean {
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ let extensionContext: vscode.ExtensionContext;
|
||||
|
||||
// The function is a duplicate of \src\paths.js. IT would be better to import path.js but it doesn't
|
||||
// work for now because the extension is running in different process.
|
||||
export function getAppDataPath() {
|
||||
function getAppDataPath() {
|
||||
let platform = process.platform;
|
||||
switch (platform) {
|
||||
case 'win32': return process.env['APPDATA'] || path.join(process.env['USERPROFILE'], 'AppData', 'Roaming');
|
||||
@@ -46,7 +46,7 @@ export function getAppDataPath() {
|
||||
}
|
||||
}
|
||||
|
||||
export function getDefaultLogLocation() {
|
||||
function getDefaultLogLocation() {
|
||||
return path.join(getAppDataPath(), 'azuredatastudio');
|
||||
}
|
||||
|
||||
@@ -132,4 +132,3 @@ function registerAzureServices(appContext: AppContext): void {
|
||||
appContext.registerService<IAzureResourceSubscriptionFilterService>(AzureResourceServiceNames.subscriptionFilterService, new AzureResourceSubscriptionFilterService(new AzureResourceCacheService(extensionContext)));
|
||||
appContext.registerService<IAzureResourceTenantService>(AzureResourceServiceNames.tenantService, new AzureResourceTenantService());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user