mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
No unused locals (#8231)
* add no unused local * fix strict null * fix compile errors * update vscode comments
This commit is contained in:
@@ -673,8 +673,8 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
|
||||
if (result) {
|
||||
const r = result.results[0];
|
||||
const galleryExtensions = r.extensions;
|
||||
const resultCount = r.resultMetadata && r.resultMetadata.filter(m => m.metadataType === 'ResultCount')[0];
|
||||
const total = resultCount && resultCount.metadataItems.filter(i => i.name === 'TotalCount')[0].count || 0;
|
||||
// const resultCount = r.resultMetadata && r.resultMetadata.filter(m => m.metadataType === 'ResultCount')[0]; {{SQL CARBON EDIT}} comment out for no unused
|
||||
// const total = resultCount && resultCount.metadataItems.filter(i => i.name === 'TotalCount')[0].count || 0; {{SQL CARBON EDIT}} comment out for no unused
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
let filteredExtensionsResult = this.createQueryResult(query, galleryExtensions);
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as path from 'vs/base/common/path';
|
||||
import * as pfs from 'vs/base/node/pfs';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { toDisposable, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { flatten, isNonEmptyArray } from 'vs/base/common/arrays';
|
||||
import { flatten/*, isNonEmptyArray*/ } from 'vs/base/common/arrays';
|
||||
import { extract, ExtractError, zip, IFile } from 'vs/base/node/zip';
|
||||
import {
|
||||
IExtensionManagementService, IExtensionGalleryService, ILocalExtension,
|
||||
@@ -205,7 +205,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
||||
return getManifest(zipPath)
|
||||
.then(manifest => {
|
||||
const identifier = { id: getGalleryExtensionId(manifest.publisher, manifest.name) };
|
||||
let operation: InstallOperation = InstallOperation.Install;
|
||||
// let operation: InstallOperation = InstallOperation.Install; {{SQL CARBON EDIT}} comment out for no unused
|
||||
// {{SQL CARBON EDIT - Check VSCode and ADS version}}
|
||||
if (manifest.engines && ((manifest.engines.vscode && !isEngineValid(manifest.engines.vscode, product.vscodeVersion)) || (manifest.engines.azdata && !isEngineValid(manifest.engines.azdata, product.version)))) {
|
||||
return Promise.reject(new Error(nls.localize('incompatible', "Unable to install extension '{0}' as it is not compatible with Azure Data Studio '{1}'.", identifier.id, product.version)));
|
||||
@@ -215,7 +215,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
||||
.then(installedExtensions => {
|
||||
const existing = installedExtensions.filter(i => areSameExtensions(identifier, i.identifier))[0];
|
||||
if (existing) {
|
||||
operation = InstallOperation.Update;
|
||||
// operation = InstallOperation.Update; {{SQL CARBON EDIT}} comment out for no unused
|
||||
if (identifierWithVersion.equals(new ExtensionIdentifierWithVersion(existing.identifier, existing.manifest.version))) {
|
||||
// {{SQL CARBON EDIT}} - Update VS Code product name
|
||||
return this.removeExtension(existing, 'existing').then(null, e => Promise.reject(new Error(nls.localize('restartCode', "Please restart Azure Data Studio before reinstalling {0}.", manifest.displayName || manifest.name))));
|
||||
@@ -267,7 +267,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
||||
return this.downloadService.download(vsix, URI.file(downloadedLocation)).then(() => URI.file(downloadedLocation));
|
||||
}
|
||||
|
||||
private installFromZipPath(identifierWithVersion: ExtensionIdentifierWithVersion, zipPath: string, metadata: IGalleryMetadata | null, type: ExtensionType, operation: InstallOperation, token: CancellationToken): Promise<ILocalExtension> {
|
||||
/*private installFromZipPath(identifierWithVersion: ExtensionIdentifierWithVersion, zipPath: string, metadata: IGalleryMetadata | null, type: ExtensionType, operation: InstallOperation, token: CancellationToken): Promise<ILocalExtension> { {{SQL CARBON EDIT}} comment out for no unused
|
||||
return this.toNonCancellablePromise(this.installExtension({ zipPath, identifierWithVersion, metadata }, type, token)
|
||||
.then(local => this.installDependenciesAndPackExtensions(local, null)
|
||||
.then(
|
||||
@@ -285,7 +285,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
||||
local => { this._onDidInstallExtension.fire({ identifier: identifierWithVersion.identifier, zipPath, local, operation }); return local; },
|
||||
error => { this._onDidInstallExtension.fire({ identifier: identifierWithVersion.identifier, zipPath, operation, error }); return Promise.reject(error); }
|
||||
));
|
||||
}
|
||||
}*/
|
||||
|
||||
async installFromGallery(extension: IGalleryExtension): Promise<ILocalExtension> {
|
||||
if (!this.galleryService.isEnabled()) {
|
||||
@@ -594,10 +594,10 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
||||
.then(() => local);
|
||||
}
|
||||
|
||||
private getMetadata(extensionName: string): Promise<IGalleryMetadata | null> {
|
||||
/*private getMetadata(extensionName: string): Promise<IGalleryMetadata | null> { {{SQL CARBON EDIT}} comment out function for no unused
|
||||
return this.findGalleryExtensionByName(extensionName)
|
||||
.then(galleryExtension => galleryExtension ? <IGalleryMetadata>{ id: galleryExtension.identifier.uuid, publisherDisplayName: galleryExtension.publisherDisplayName, publisherId: galleryExtension.publisherId } : null);
|
||||
}
|
||||
}*/
|
||||
|
||||
private findGalleryExtension(local: ILocalExtension): Promise<IGalleryExtension> {
|
||||
if (local.identifier.uuid) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { toDisposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { safeStringify } from 'vs/base/common/objects';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
|
||||
type ErrorEventFragment = {
|
||||
/*type ErrorEventFragment = { {{SQL CARBON EDIT}} comment out for no unused
|
||||
callstack: { classification: 'CallstackOrException', purpose: 'PerformanceAndHealth' };
|
||||
msg?: { classification: 'CallstackOrException', purpose: 'PerformanceAndHealth' };
|
||||
file?: { classification: 'CallstackOrException', purpose: 'PerformanceAndHealth' };
|
||||
@@ -18,7 +18,7 @@ type ErrorEventFragment = {
|
||||
uncaught_error_name?: { classification: 'CallstackOrException', purpose: 'PerformanceAndHealth' };
|
||||
uncaught_error_msg?: { classification: 'CallstackOrException', purpose: 'PerformanceAndHealth' };
|
||||
count?: { classification: 'CallstackOrException', purpose: 'PerformanceAndHealth', isMeasurement: true };
|
||||
};
|
||||
};*/
|
||||
export interface ErrorEvent {
|
||||
callstack: string;
|
||||
msg?: string;
|
||||
@@ -45,14 +45,14 @@ export default abstract class BaseErrorTelemetry {
|
||||
|
||||
public static ERROR_FLUSH_TIMEOUT: number = 5 * 1000;
|
||||
|
||||
private _telemetryService: ITelemetryService;
|
||||
// private _telemetryService: ITelemetryService; {{SQL CARBON EDIT}} comment out for no unused
|
||||
private _flushDelay: number;
|
||||
private _flushHandle: any = -1;
|
||||
private _buffer: ErrorEvent[] = [];
|
||||
protected readonly _disposables = new DisposableStore();
|
||||
|
||||
constructor(telemetryService: ITelemetryService, flushDelay = BaseErrorTelemetry.ERROR_FLUSH_TIMEOUT) {
|
||||
this._telemetryService = telemetryService;
|
||||
// this._telemetryService = telemetryService; {{SQL CARBON EDIT}} comment out for no unused
|
||||
this._flushDelay = flushDelay;
|
||||
|
||||
// (1) check for unexpected but handled errors
|
||||
@@ -118,10 +118,10 @@ export default abstract class BaseErrorTelemetry {
|
||||
}
|
||||
|
||||
private _flushBuffer(): void {
|
||||
for (let error of this._buffer) {
|
||||
/*for (let error of this._buffer) { {{SQL CARBON EDIT}} don't log errors
|
||||
type UnhandledErrorClassification = {} & ErrorEventFragment;
|
||||
// this._telemetryService.publicLog2<ErrorEvent, UnhandledErrorClassification>('UnhandledError', error, true); {{SQL CARBON EDIT}} comment out log
|
||||
}
|
||||
this._telemetryService.publicLog2<ErrorEvent, UnhandledErrorClassification>('UnhandledError', error, true);
|
||||
}*/
|
||||
this._buffer.length = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,11 +96,11 @@ export async function resolveCommonProperties(
|
||||
return result;
|
||||
}
|
||||
|
||||
function verifyMicrosoftInternalDomain(domainList: readonly string[]): boolean {
|
||||
/*function verifyMicrosoftInternalDomain(domainList: readonly string[]): boolean { {{SQL CARBON EDIT}} comment out for no unused
|
||||
if (!process || !process.env || !process.env['USERDNSDOMAIN']) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const domain = process.env['USERDNSDOMAIN']!.toLowerCase();
|
||||
return domainList.some(msftDomain => domain === msftDomain);
|
||||
}
|
||||
}*/
|
||||
|
||||
Reference in New Issue
Block a user