mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 4636be2b71c87bfb0bfe3c94278b447a5efcc1f1 (#8722)
* Merge from vscode 4636be2b71c87bfb0bfe3c94278b447a5efcc1f1 * remove tests that aren't working
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import * as path from 'vs/base/common/path';
|
||||
|
||||
export class DeltaExtensionsResult {
|
||||
constructor(
|
||||
@@ -27,6 +28,9 @@ export class ExtensionDescriptionRegistry {
|
||||
}
|
||||
|
||||
private _initialize(): void {
|
||||
// Ensure extensions are stored in the order: builtin, user, under development
|
||||
this._extensionDescriptions.sort(extensionCmp);
|
||||
|
||||
this._extensionsMap = new Map<string, IExtensionDescription>();
|
||||
this._extensionsArr = [];
|
||||
this._activationMap = new Map<string, IExtensionDescription[]>();
|
||||
@@ -193,3 +197,34 @@ export class ExtensionDescriptionRegistry {
|
||||
return extension ? extension : undefined;
|
||||
}
|
||||
}
|
||||
|
||||
const enum SortBucket {
|
||||
Builtin = 0,
|
||||
User = 1,
|
||||
Dev = 2
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that:
|
||||
* - first are builtin extensions
|
||||
* - second are user extensions
|
||||
* - third are extensions under development
|
||||
*
|
||||
* In each bucket, extensions must be sorted alphabetically by their folder name.
|
||||
*/
|
||||
function extensionCmp(a: IExtensionDescription, b: IExtensionDescription): number {
|
||||
const aSortBucket = (a.isBuiltin ? SortBucket.Builtin : a.isUnderDevelopment ? SortBucket.Dev : SortBucket.User);
|
||||
const bSortBucket = (b.isBuiltin ? SortBucket.Builtin : b.isUnderDevelopment ? SortBucket.Dev : SortBucket.User);
|
||||
if (aSortBucket !== bSortBucket) {
|
||||
return aSortBucket - bSortBucket;
|
||||
}
|
||||
const aLastSegment = path.posix.basename(a.extensionLocation.path);
|
||||
const bLastSegment = path.posix.basename(b.extensionLocation.path);
|
||||
if (aLastSegment < bLastSegment) {
|
||||
return -1;
|
||||
}
|
||||
if (aLastSegment > bLastSegment) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,10 @@ export class LazyPromise implements Promise<any> {
|
||||
this._err = null;
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag](): string {
|
||||
return this.toString();
|
||||
}
|
||||
|
||||
private _ensureActual(): Promise<any> {
|
||||
if (!this._actual) {
|
||||
this._actual = new Promise<any>((c, e) => {
|
||||
|
||||
@@ -38,6 +38,7 @@ import { flatten } from 'vs/base/common/arrays';
|
||||
import { IStaticExtensionsService } from 'vs/workbench/services/extensions/common/staticExtensions';
|
||||
import { IElectronService } from 'vs/platform/electron/node/electron';
|
||||
import { IElectronEnvironmentService } from 'vs/workbench/services/electron/electron-browser/electronEnvironmentService';
|
||||
import { IRemoteExplorerService } from 'vs/workbench/services/remote/common/remoteExplorerService';
|
||||
|
||||
class DeltaExtensionsQueueItem {
|
||||
constructor(
|
||||
@@ -70,7 +71,8 @@ export class ExtensionService extends AbstractExtensionService implements IExten
|
||||
@IStaticExtensionsService private readonly _staticExtensions: IStaticExtensionsService,
|
||||
@IElectronService private readonly _electronService: IElectronService,
|
||||
@IHostService private readonly _hostService: IHostService,
|
||||
@IElectronEnvironmentService private readonly _electronEnvironmentService: IElectronEnvironmentService
|
||||
@IElectronEnvironmentService private readonly _electronEnvironmentService: IElectronEnvironmentService,
|
||||
@IRemoteExplorerService private readonly _remoteExplorerService: IRemoteExplorerService
|
||||
) {
|
||||
super(
|
||||
instantiationService,
|
||||
@@ -476,6 +478,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten
|
||||
|
||||
// set the resolved authority
|
||||
this._remoteAuthorityResolverService.setResolvedAuthority(resolvedAuthority.authority, resolvedAuthority.options);
|
||||
this._remoteExplorerService.addDetected(resolvedAuthority.tunnelInformation?.detectedTunnels);
|
||||
|
||||
// monitor for breakage
|
||||
const connection = this._remoteAgentService.getConnection();
|
||||
|
||||
@@ -21,7 +21,7 @@ import { ExtHostExtensionService } from 'vs/workbench/api/worker/extHostExtensio
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { ExtHostLogService } from 'vs/workbench/api/worker/extHostLogService';
|
||||
import { IExtHostTunnelService } from 'vs/workbench/api/common/extHostTunnelService';
|
||||
import { IExtHostTunnelService, ExtHostTunnelService } from 'vs/workbench/api/common/extHostTunnelService';
|
||||
|
||||
// register singleton services
|
||||
registerSingleton(ILogService, ExtHostLogService);
|
||||
@@ -34,6 +34,7 @@ registerSingleton(IExtHostDocumentsAndEditors, ExtHostDocumentsAndEditors);
|
||||
registerSingleton(IExtHostStorage, ExtHostStorage);
|
||||
registerSingleton(IExtHostExtensionService, ExtHostExtensionService);
|
||||
registerSingleton(IExtHostSearch, ExtHostSearch);
|
||||
registerSingleton(IExtHostTunnelService, ExtHostTunnelService);
|
||||
|
||||
// register services that only throw errors
|
||||
function NotImplementedProxy<T>(name: ServiceIdentifier<T>): { new(): T } {
|
||||
@@ -54,4 +55,3 @@ registerSingleton(IExtHostTerminalService, WorkerExtHostTerminalService);
|
||||
// registerSingleton(IExtHostTask, WorkerExtHostTask); {{SQL CARBON EDIT}} disable
|
||||
// registerSingleton(IExtHostDebugService, WorkerExtHostDebugService); {{SQL CARBON EDIT}} disable
|
||||
registerSingleton(IExtensionStoragePaths, class extends NotImplementedProxy(IExtensionStoragePaths) { whenReady = Promise.resolve(); });
|
||||
registerSingleton(IExtHostTunnelService, class extends NotImplementedProxy(IExtHostTunnelService) { });
|
||||
|
||||
Reference in New Issue
Block a user