mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 10:58:31 -05:00
This reverts commit 6bd0a17d3c.
This commit is contained in:
@@ -52,19 +52,6 @@
|
||||
Object.keys(self.webPackagePaths).map(function (key, index) {
|
||||
self.webPackagePaths[key] = `${baseUrl}/node_modules/${key}/${self.webPackagePaths[key]}`;
|
||||
});
|
||||
|
||||
// Set up nls if the user is not using the default language (English)
|
||||
const nlsConfig = {};
|
||||
const locale = window.localStorage.getItem('vscode.nls.locale') || navigator.language;
|
||||
if (!locale.startsWith('en')) {
|
||||
nlsConfig['vs/nls'] = {
|
||||
availableLanguages: {
|
||||
'*': locale
|
||||
},
|
||||
translationServiceUrl: '{{WORKBENCH_NLS_BASE_URL}}'
|
||||
};
|
||||
}
|
||||
|
||||
require.config({
|
||||
baseUrl: `${baseUrl}/out`,
|
||||
recordStats: true,
|
||||
@@ -117,7 +104,7 @@
|
||||
'plotly.js-dist-min': `${window.location.origin}/static/node_modules/plotly.js-dist-min/plotly.min.js`,
|
||||
'azdataGraph': `${window.location.origin}/static/node_modules/azdataGraph/dist/build.js`
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -3,186 +3,27 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Disposable, DisposableStore, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IExtensionGalleryService, IExtensionIdentifier, IGlobalExtensionEnablementService, ServerDidUninstallExtensionEvent, ServerInstallExtensionResult, UninstallOptions } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { getIdAndVersion } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
|
||||
import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IExtensionGalleryService, IExtensionManagementService, IGlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionStorageService, IExtensionStorageService } from 'vs/platform/extensionManagement/common/extensionStorage';
|
||||
import { migrateUnsupportedExtensions } from 'vs/platform/extensionManagement/common/unsupportedExtensionsMigration';
|
||||
import { INativeServerExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService';
|
||||
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
|
||||
import { DidChangeProfilesEvent, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile';
|
||||
|
||||
const uninstalOptions: UninstallOptions = { versionOnly: true, donotIncludePack: true, donotCheckDependents: true };
|
||||
|
||||
export class ExtensionsCleaner extends Disposable {
|
||||
|
||||
constructor(
|
||||
@INativeServerExtensionManagementService extensionManagementService: INativeServerExtensionManagementService,
|
||||
@IUserDataProfilesService private readonly userDataProfilesService: IUserDataProfilesService,
|
||||
@IExtensionManagementService extensionManagementService: ExtensionManagementService,
|
||||
@IExtensionGalleryService extensionGalleryService: IExtensionGalleryService,
|
||||
@IExtensionStorageService extensionStorageService: IExtensionStorageService,
|
||||
@IGlobalExtensionEnablementService extensionEnablementService: IGlobalExtensionEnablementService,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IStorageService storageService: IStorageService,
|
||||
@ILogService logService: ILogService,
|
||||
) {
|
||||
super();
|
||||
|
||||
extensionManagementService.removeUninstalledExtensions(this.userDataProfilesService.profiles.length === 1);
|
||||
extensionManagementService.removeDeprecatedExtensions();
|
||||
migrateUnsupportedExtensions(extensionManagementService, extensionGalleryService, extensionStorageService, extensionEnablementService, logService);
|
||||
ExtensionStorageService.removeOutdatedExtensionVersions(extensionManagementService, storageService);
|
||||
this._register(instantiationService.createInstance(ProfileExtensionsCleaner));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ProfileExtensionsCleaner extends Disposable {
|
||||
|
||||
private profileExtensionsLocations = new Map<string, URI[]>(); // {{SQL CARBON EDIT}} lewissanchez - Added parenthesis
|
||||
|
||||
private readonly profileModeDisposables = this._register(new MutableDisposable<DisposableStore>());
|
||||
|
||||
constructor(
|
||||
@INativeServerExtensionManagementService private readonly extensionManagementService: INativeServerExtensionManagementService,
|
||||
@IUserDataProfilesService private readonly userDataProfilesService: IUserDataProfilesService,
|
||||
@IExtensionsProfileScannerService private readonly extensionsProfileScannerService: IExtensionsProfileScannerService,
|
||||
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService,
|
||||
@ILogService private readonly logService: ILogService,
|
||||
) {
|
||||
super();
|
||||
this.onDidChangeProfiles({ added: this.userDataProfilesService.profiles, removed: [], all: this.userDataProfilesService.profiles });
|
||||
}
|
||||
|
||||
private async onDidChangeProfiles({ added, removed, all }: Omit<DidChangeProfilesEvent, 'updated'>): Promise<void> {
|
||||
try {
|
||||
await Promise.all(removed.map(profile => profile.extensionsResource ? this.removeExtensionsFromProfile(profile.extensionsResource) : Promise.resolve()));
|
||||
} catch (error) {
|
||||
this.logService.error(error);
|
||||
}
|
||||
|
||||
if (all.length === 1) {
|
||||
// Exit profile mode
|
||||
this.profileModeDisposables.clear();
|
||||
// Listen for entering into profile mode
|
||||
const disposable = this._register(this.userDataProfilesService.onDidChangeProfiles(() => {
|
||||
disposable.dispose();
|
||||
this.onDidChangeProfiles({ added: this.userDataProfilesService.profiles, removed: [], all: this.userDataProfilesService.profiles });
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (added.length) {
|
||||
await Promise.all(added.map(profile => profile.extensionsResource ? this.populateExtensionsFromProfile(profile.extensionsResource) : Promise.resolve()));
|
||||
// Enter profile mode
|
||||
if (!this.profileModeDisposables.value) {
|
||||
this.profileModeDisposables.value = new DisposableStore();
|
||||
this.profileModeDisposables.value.add(toDisposable(() => this.profileExtensionsLocations.clear()));
|
||||
this.profileModeDisposables.value.add(this.userDataProfilesService.onDidChangeProfiles(e => this.onDidChangeProfiles(e)));
|
||||
this.profileModeDisposables.value.add(this.extensionManagementService.onDidInstallExtensions(e => this.onDidInstallExtensions(e)));
|
||||
this.profileModeDisposables.value.add(this.extensionManagementService.onDidUninstallExtension(e => this.onDidUninstallExtension(e)));
|
||||
await this.uninstallExtensionsNotInProfiles();
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
this.logService.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
private async uninstallExtensionsNotInProfiles(): Promise<void> {
|
||||
const installed = await this.extensionManagementService.getAllUserInstalled();
|
||||
const toUninstall = installed.filter(installedExtension => !this.profileExtensionsLocations.has(this.getKey(installedExtension.identifier, installedExtension.manifest.version)));
|
||||
if (toUninstall.length) {
|
||||
await Promise.all(toUninstall.map(extension => this.extensionManagementService.uninstall(extension, uninstalOptions)));
|
||||
}
|
||||
}
|
||||
|
||||
private async onDidInstallExtensions(installedExtensions: readonly ServerInstallExtensionResult[]): Promise<void> {
|
||||
for (const { local, profileLocation } of installedExtensions) {
|
||||
if (!local || !profileLocation) {
|
||||
continue;
|
||||
}
|
||||
this.addExtensionWithKey(this.getKey(local.identifier, local.manifest.version), profileLocation);
|
||||
}
|
||||
}
|
||||
|
||||
private async onDidUninstallExtension(e: ServerDidUninstallExtensionEvent): Promise<void> {
|
||||
if (!e.profileLocation || !e.version) {
|
||||
return;
|
||||
}
|
||||
if (this.removeExtensionWithKey(this.getKey(e.identifier, e.version), e.profileLocation)) {
|
||||
await this.uninstallExtensions([{ identifier: e.identifier, version: e.version }]);
|
||||
}
|
||||
}
|
||||
|
||||
private async populateExtensionsFromProfile(extensionsProfileLocation: URI): Promise<void> {
|
||||
const extensions = await this.extensionsProfileScannerService.scanProfileExtensions(extensionsProfileLocation);
|
||||
for (const extension of extensions) {
|
||||
this.addExtensionWithKey(this.getKey(extension.identifier, extension.version), extensionsProfileLocation);
|
||||
}
|
||||
}
|
||||
|
||||
private async removeExtensionsFromProfile(removedProfile: URI): Promise<void> {
|
||||
const extensionsToRemove: { identifier: IExtensionIdentifier; version: string }[] = [];
|
||||
for (const key of [...this.profileExtensionsLocations.keys()]) {
|
||||
if (!this.removeExtensionWithKey(key, removedProfile)) {
|
||||
continue;
|
||||
}
|
||||
const extensionToRemove = this.fromKey(key);
|
||||
if (extensionToRemove) {
|
||||
extensionsToRemove.push(extensionToRemove);
|
||||
}
|
||||
}
|
||||
if (extensionsToRemove.length) {
|
||||
await this.uninstallExtensions(extensionsToRemove);
|
||||
}
|
||||
}
|
||||
|
||||
private addExtensionWithKey(key: string, extensionsProfileLocation: URI): void {
|
||||
let locations = this.profileExtensionsLocations.get(key);
|
||||
if (!locations) {
|
||||
locations = [];
|
||||
this.profileExtensionsLocations.set(key, locations);
|
||||
}
|
||||
locations.push(extensionsProfileLocation);
|
||||
}
|
||||
|
||||
private removeExtensionWithKey(key: string, profileLocation: URI): boolean {
|
||||
const profiles = this.profileExtensionsLocations.get(key);
|
||||
if (profiles) {
|
||||
const index = profiles.findIndex(profile => this.uriIdentityService.extUri.isEqual(profile, profileLocation));
|
||||
if (index > -1) {
|
||||
profiles.splice(index, 1);
|
||||
}
|
||||
}
|
||||
if (!profiles?.length) {
|
||||
this.profileExtensionsLocations.delete(key);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private async uninstallExtensions(extensionsToRemove: { identifier: IExtensionIdentifier; version: string }[]): Promise<void> {
|
||||
const installed = await this.extensionManagementService.getAllUserInstalled();
|
||||
const toUninstall = installed.filter(installedExtension => extensionsToRemove.some(e => this.getKey(installedExtension.identifier, installedExtension.manifest.version) === this.getKey(e.identifier, e.version)));
|
||||
if (toUninstall.length) {
|
||||
await Promise.all(toUninstall.map(extension => this.extensionManagementService.uninstall(extension, uninstalOptions)));
|
||||
}
|
||||
}
|
||||
|
||||
private getKey(identifier: IExtensionIdentifier, version: string): string {
|
||||
return `${ExtensionIdentifier.toKey(identifier.id)}@${version}`;
|
||||
}
|
||||
|
||||
private fromKey(key: string): { identifier: IExtensionIdentifier; version: string } | undefined {
|
||||
const [id, version] = getIdAndVersion(key);
|
||||
return version ? { identifier: { id }, version } : undefined;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ export class LanguagePackCachedDataCleaner extends Disposable {
|
||||
try {
|
||||
const installed: IStringDictionary<boolean> = Object.create(null);
|
||||
const metaData: ILanguagePackFile = JSON.parse(await Promises.readFile(join(this.environmentService.userDataPath, 'languagepacks.json'), 'utf8'));
|
||||
for (const locale of Object.keys(metaData)) {
|
||||
for (let locale of Object.keys(metaData)) {
|
||||
const entry = metaData[locale];
|
||||
installed[`${entry.hash}.${locale}`] = true;
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks';
|
||||
import { NativeLanguagePackService } from 'vs/platform/languagePacks/node/languagePacks';
|
||||
import { ILocalizationsService } from 'vs/platform/localizations/common/localizations';
|
||||
import { LocalizationsService } from 'vs/platform/localizations/node/localizations';
|
||||
|
||||
export class LocalizationsUpdater extends Disposable {
|
||||
|
||||
constructor(
|
||||
@ILanguagePackService private readonly localizationsService: NativeLanguagePackService
|
||||
@ILocalizationsService private readonly localizationsService: LocalizationsService
|
||||
) {
|
||||
super();
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ import { INativeEnvironmentService } from 'vs/platform/environment/common/enviro
|
||||
import { SharedProcessEnvironmentService } from 'vs/platform/sharedProcess/node/sharedProcessEnvironmentService';
|
||||
import { GlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionEnablementService';
|
||||
import { ExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionGalleryService';
|
||||
import { IDefaultExtensionsProfileInitService, IExtensionGalleryService, IExtensionManagementService, IExtensionTipsService, IGlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { IExtensionGalleryService, IExtensionManagementService, IExtensionTipsService, IGlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionManagementChannel, ExtensionTipsChannel } from 'vs/platform/extensionManagement/common/extensionManagementIpc';
|
||||
import { ExtensionTipsService } from 'vs/platform/extensionManagement/electron-sandbox/extensionTipsService';
|
||||
import { ExtensionManagementService, INativeServerExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService';
|
||||
import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService';
|
||||
import { IExtensionRecommendationNotificationService } from 'vs/platform/extensionRecommendations/common/extensionRecommendations';
|
||||
import { ExtensionRecommendationNotificationServiceChannelClient } from 'vs/platform/extensionRecommendations/electron-sandbox/extensionRecommendationsIpc';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
@@ -46,13 +46,14 @@ import { InstantiationService } from 'vs/platform/instantiation/common/instantia
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { MessagePortMainProcessService } from 'vs/platform/ipc/electron-browser/mainProcessService';
|
||||
import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services';
|
||||
import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks';
|
||||
import { NativeLanguagePackService } from 'vs/platform/languagePacks/node/languagePacks';
|
||||
import { ILocalizationsService } from 'vs/platform/localizations/common/localizations';
|
||||
import { LocalizationsService } from 'vs/platform/localizations/node/localizations';
|
||||
import { ConsoleLogger, ILoggerService, ILogService, MultiplexLogService } from 'vs/platform/log/common/log';
|
||||
import { FollowerLogService, LoggerChannelClient, LogLevelChannelClient } from 'vs/platform/log/common/logIpc';
|
||||
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { RequestService } from 'vs/platform/request/browser/requestService';
|
||||
import { IRequestService } from 'vs/platform/request/common/request';
|
||||
import { ISharedProcessConfiguration } from 'vs/platform/sharedProcess/node/sharedProcess';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
@@ -62,7 +63,7 @@ import { ICustomEndpointTelemetryService, ITelemetryService } from 'vs/platform/
|
||||
import { TelemetryAppenderChannel } from 'vs/platform/telemetry/common/telemetryIpc';
|
||||
import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogAppender';
|
||||
import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
|
||||
import { supportsTelemetry, ITelemetryAppender, NullAppender, NullTelemetryService, getPiiPathsFromEnvironment, isInternalTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { supportsTelemetry, ITelemetryAppender, NullAppender, NullTelemetryService, isInternalTelemetry, getPiiPathsFromEnvironment } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { CustomEndpointTelemetryService } from 'vs/platform/telemetry/node/customEndpointTelemetryService';
|
||||
import { LocalReconnectConstants, TerminalIpcChannels, TerminalSettingId } from 'vs/platform/terminal/common/terminal';
|
||||
import { ILocalPtyService } from 'vs/platform/terminal/electron-sandbox/terminal';
|
||||
@@ -89,7 +90,7 @@ import { ipcSharedProcessTunnelChannelName, ISharedProcessTunnelService } from '
|
||||
import { SharedProcessTunnelService } from 'vs/platform/tunnel/node/sharedProcessTunnelService';
|
||||
import { ipcSharedProcessWorkerChannelName, ISharedProcessWorkerConfiguration, ISharedProcessWorkerService } from 'vs/platform/sharedProcess/common/sharedProcessWorkerService';
|
||||
import { SharedProcessWorkerService } from 'vs/platform/sharedProcess/electron-browser/sharedProcessWorkerService';
|
||||
// import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender'; // {{SQL CARBON EDIT}} - Unused import
|
||||
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
|
||||
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
|
||||
import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService';
|
||||
import { isLinux } from 'vs/base/common/platform';
|
||||
@@ -99,14 +100,6 @@ import { InspectProfilingService as V8InspectProfilingService } from 'vs/platfor
|
||||
import { IV8InspectProfilingService } from 'vs/platform/profiling/common/profiling';
|
||||
import { IExtensionsScannerService } from 'vs/platform/extensionManagement/common/extensionsScannerService';
|
||||
import { ExtensionsScannerService } from 'vs/platform/extensionManagement/node/extensionsScannerService';
|
||||
import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile';
|
||||
import { ExtensionsProfileScannerService, IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService';
|
||||
import { PolicyChannelClient } from 'vs/platform/policy/common/policyIpc';
|
||||
import { IPolicyService, NullPolicyService } from 'vs/platform/policy/common/policy';
|
||||
import { UserDataProfilesNativeService } from 'vs/platform/userDataProfile/electron-sandbox/userDataProfile';
|
||||
import { OneDataSystemWebAppender } from 'vs/platform/telemetry/browser/1dsAppender';
|
||||
import { DefaultExtensionsProfileInitService } from 'vs/platform/extensionManagement/electron-sandbox/defaultExtensionsProfileInit';
|
||||
import { SharedProcessRequestService } from 'vs/platform/request/electron-browser/sharedProcessRequestService';
|
||||
|
||||
class SharedProcessMain extends Disposable {
|
||||
|
||||
@@ -187,10 +180,6 @@ class SharedProcessMain extends Disposable {
|
||||
const mainProcessService = new MessagePortMainProcessService(this.server, mainRouter);
|
||||
services.set(IMainProcessService, mainProcessService);
|
||||
|
||||
// Policies
|
||||
const policyService = this.configuration.policiesData ? new PolicyChannelClient(this.configuration.policiesData, mainProcessService.getChannel('policy')) : new NullPolicyService();
|
||||
services.set(IPolicyService, policyService);
|
||||
|
||||
// Environment
|
||||
const environmentService = new SharedProcessEnvironmentService(this.configuration.args, productService);
|
||||
services.set(INativeEnvironmentService, environmentService);
|
||||
@@ -232,16 +221,12 @@ class SharedProcessMain extends Disposable {
|
||||
));
|
||||
fileService.registerProvider(Schemas.vscodeUserData, userDataFileSystemProvider);
|
||||
|
||||
// User Data Profiles
|
||||
const userDataProfilesService = this._register(new UserDataProfilesNativeService(this.configuration.profiles, mainProcessService, environmentService));
|
||||
services.set(IUserDataProfilesService, userDataProfilesService);
|
||||
|
||||
// Configuration
|
||||
const configurationService = this._register(new ConfigurationService(userDataProfilesService.defaultProfile.settingsResource, fileService, policyService, logService));
|
||||
const configurationService = this._register(new ConfigurationService(environmentService.settingsResource, fileService));
|
||||
services.set(IConfigurationService, configurationService);
|
||||
|
||||
// Storage (global access only)
|
||||
const storageService = new NativeStorageService(undefined, { defaultProfile: userDataProfilesService.defaultProfile, currentProfile: userDataProfilesService.defaultProfile }, mainProcessService, environmentService);
|
||||
const storageService = new NativeStorageService(undefined, mainProcessService, environmentService);
|
||||
services.set(IStorageService, storageService);
|
||||
this._register(toDisposable(() => storageService.flush()));
|
||||
|
||||
@@ -255,7 +240,7 @@ class SharedProcessMain extends Disposable {
|
||||
services.set(IUriIdentityService, new UriIdentityService(fileService));
|
||||
|
||||
// Request
|
||||
services.set(IRequestService, new SharedProcessRequestService(mainProcessService, configurationService, logService));
|
||||
services.set(IRequestService, new SyncDescriptor(RequestService));
|
||||
|
||||
// Checksum
|
||||
services.set(IChecksumService, new SyncDescriptor(ChecksumService));
|
||||
@@ -284,14 +269,14 @@ class SharedProcessMain extends Disposable {
|
||||
appenders.push(logAppender);
|
||||
const { installSourcePath } = environmentService;
|
||||
if (productService.aiConfig?.ariaKey) {
|
||||
const collectorAppender = new OneDataSystemWebAppender(internalTelemetry, 'adsworkbench', null, productService.aiConfig.ariaKey); // {{SQL CARBON EDIT}} Use our own event prefix
|
||||
const collectorAppender = new OneDataSystemAppender(internalTelemetry, 'adsworkbench', null, productService.aiConfig.ariaKey); // {{SQL CARBON EDIT}} Use our own event prefix
|
||||
this._register(toDisposable(() => collectorAppender.flush())); // Ensure the 1DS appender is disposed so that it flushes remaining data
|
||||
appenders.push(collectorAppender);
|
||||
}
|
||||
|
||||
telemetryService = new TelemetryService({
|
||||
appenders,
|
||||
commonProperties: resolveCommonProperties(fileService, release(), hostname(), process.arch, productService.commit, productService.version, this.configuration.machineId, internalTelemetry, installSourcePath),
|
||||
commonProperties: resolveCommonProperties(fileService, release(), hostname(), process.arch, productService.commit, productService.version, this.configuration.machineId, productService.msftInternalDomains, installSourcePath),
|
||||
sendErrorTelemetry: true,
|
||||
piiPaths: getPiiPathsFromEnvironment(environmentService),
|
||||
}, configurationService, productService);
|
||||
@@ -309,10 +294,8 @@ class SharedProcessMain extends Disposable {
|
||||
services.set(ICustomEndpointTelemetryService, customEndpointTelemetryService);
|
||||
|
||||
// Extension Management
|
||||
services.set(IExtensionsProfileScannerService, new SyncDescriptor(ExtensionsProfileScannerService));
|
||||
services.set(IExtensionsScannerService, new SyncDescriptor(ExtensionsScannerService));
|
||||
services.set(INativeServerExtensionManagementService, new SyncDescriptor(ExtensionManagementService));
|
||||
services.set(IDefaultExtensionsProfileInitService, new SyncDescriptor(DefaultExtensionsProfileInitService));
|
||||
services.set(IExtensionManagementService, new SyncDescriptor(ExtensionManagementService));
|
||||
|
||||
// Extension Gallery
|
||||
services.set(IExtensionGalleryService, new SyncDescriptor(ExtensionGalleryService));
|
||||
@@ -321,7 +304,7 @@ class SharedProcessMain extends Disposable {
|
||||
services.set(IExtensionTipsService, new SyncDescriptor(ExtensionTipsService));
|
||||
|
||||
// Localizations
|
||||
services.set(ILanguagePackService, new SyncDescriptor(NativeLanguagePackService));
|
||||
services.set(ILocalizationsService, new SyncDescriptor(LocalizationsService));
|
||||
|
||||
// Diagnostics
|
||||
services.set(IDiagnosticsService, new SyncDescriptor(DiagnosticsService));
|
||||
@@ -370,9 +353,9 @@ class SharedProcessMain extends Disposable {
|
||||
const channel = new ExtensionManagementChannel(accessor.get(IExtensionManagementService), () => null);
|
||||
this.server.registerChannel('extensions', channel);
|
||||
|
||||
// Language Packs
|
||||
const languagePacksChannel = ProxyChannel.fromService(accessor.get(ILanguagePackService));
|
||||
this.server.registerChannel('languagePacks', languagePacksChannel);
|
||||
// Localizations
|
||||
const localizationsChannel = ProxyChannel.fromService(accessor.get(ILocalizationsService));
|
||||
this.server.registerChannel('localizations', localizationsChannel);
|
||||
|
||||
// Diagnostics
|
||||
const diagnosticsChannel = ProxyChannel.fromService(accessor.get(IDiagnosticsService));
|
||||
@@ -423,9 +406,6 @@ class SharedProcessMain extends Disposable {
|
||||
// Worker
|
||||
const sharedProcessWorkerChannel = ProxyChannel.fromService(accessor.get(ISharedProcessWorkerService));
|
||||
this.server.registerChannel(ipcSharedProcessWorkerChannelName, sharedProcessWorkerChannel);
|
||||
|
||||
// Default Extensions Profile Init
|
||||
this.server.registerChannel('IDefaultExtensionsProfileInitService', ProxyChannel.fromService(accessor.get(IDefaultExtensionsProfileInitService)));
|
||||
}
|
||||
|
||||
private registerErrorHandler(logService: ILogService): void {
|
||||
|
||||
19
src/vs/code/electron-browser/workbench/workbench.html
Normal file
19
src/vs/code/electron-browser/workbench/workbench.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self' https: data: blob: vscode-remote-resource:; media-src 'none'; frame-src 'self' vscode-webview:; object-src 'self'; script-src 'self' 'unsafe-eval' blob:; style-src 'self' 'unsafe-inline'; connect-src 'self' https: ws:; font-src 'self' https: vscode-remote-resource:;">
|
||||
<!-- <meta http-equiv="Content-Security-Policy" content="require-trusted-types-for 'script'; trusted-types TrustedFunctionWorkaround ExtensionScripts amdLoader cellRendererEditorText defaultWorkerFactory diffEditorWidget editorGhostText domLineBreaksComputer editorViewLayer diffReview extensionHostWorker insane notebookRenderer safeInnerHtml standaloneColorizer tokenizeToString webNestedWorkerExtensionHost;"> {{SQL CARBON EDIT}} TODO Comment out until we can investigate a proper fix for ADS not starting up -->
|
||||
</head>
|
||||
<body aria-label="">
|
||||
</body>
|
||||
|
||||
<!-- Init Bootstrap Helpers -->
|
||||
<script src="../../../../bootstrap.js"></script>
|
||||
<script src="../../../../vs/loader.js"></script>
|
||||
<script src="../../../../bootstrap-window.js"></script>
|
||||
|
||||
<!-- Startup via workbench.js -->
|
||||
<script src="workbench.js"></script>
|
||||
</html>
|
||||
214
src/vs/code/electron-browser/workbench/workbench.js
Normal file
214
src/vs/code/electron-browser/workbench/workbench.js
Normal file
@@ -0,0 +1,214 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/// <reference path="../../../../typings/require.d.ts" />
|
||||
|
||||
//@ts-check
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
const bootstrapWindow = bootstrapWindowLib();
|
||||
|
||||
// Add a perf entry right from the top
|
||||
performance.mark('code/didStartRenderer');
|
||||
|
||||
// Load workbench main JS, CSS and NLS all in parallel. This is an
|
||||
// optimization to prevent a waterfall of loading to happen, because
|
||||
// we know for a fact that workbench.desktop.main will depend on
|
||||
// the related CSS and NLS counterparts.
|
||||
bootstrapWindow.load([
|
||||
'sql/setup', // {{SQL CARBON EDIT}}
|
||||
'vs/workbench/workbench.desktop.main',
|
||||
'vs/nls!vs/workbench/workbench.desktop.main',
|
||||
'vs/css!vs/workbench/workbench.desktop.main'
|
||||
],
|
||||
function (_, configuration) {
|
||||
|
||||
// Mark start of workbench
|
||||
performance.mark('code/didLoadWorkbenchMain');
|
||||
|
||||
// @ts-ignore
|
||||
return require('vs/workbench/electron-sandbox/desktop.main').main(configuration);
|
||||
},
|
||||
{
|
||||
configureDeveloperSettings: function (windowConfig) {
|
||||
return {
|
||||
// disable automated devtools opening on error when running extension tests
|
||||
// as this can lead to nondeterministic test execution (devtools steals focus)
|
||||
forceDisableShowDevtoolsOnError: typeof windowConfig.extensionTestsPath === 'string',
|
||||
// enable devtools keybindings in extension development window
|
||||
forceEnableDeveloperKeybindings: Array.isArray(windowConfig.extensionDevelopmentPath) && windowConfig.extensionDevelopmentPath.length > 0,
|
||||
removeDeveloperKeybindingsAfterLoad: true
|
||||
};
|
||||
},
|
||||
canModifyDOM: function (windowConfig) {
|
||||
showSplash(windowConfig);
|
||||
},
|
||||
beforeLoaderConfig: function (loaderConfig) {
|
||||
loaderConfig.recordStats = true;
|
||||
},
|
||||
beforeRequire: function () {
|
||||
performance.mark('code/willLoadWorkbenchMain');
|
||||
|
||||
// It looks like browsers only lazily enable
|
||||
// the <canvas> element when needed. Since we
|
||||
// leverage canvas elements in our code in many
|
||||
// locations, we try to help the browser to
|
||||
// initialize canvas when it is idle, right
|
||||
// before we wait for the scripts to be loaded.
|
||||
// @ts-ignore
|
||||
window.requestIdleCallback(() => {
|
||||
const canvas = document.createElement('canvas');
|
||||
const context = canvas.getContext('2d');
|
||||
context.clearRect(0, 0, canvas.width, canvas.height);
|
||||
canvas.remove();
|
||||
}, { timeout: 50 });
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
//#region Helpers
|
||||
|
||||
/**
|
||||
* @typedef {import('../../../platform/window/common/window').INativeWindowConfiguration} INativeWindowConfiguration
|
||||
* @typedef {import('../../../platform/environment/common/argv').NativeParsedArgs} NativeParsedArgs
|
||||
*
|
||||
* @returns {{
|
||||
* load: (
|
||||
* modules: string[],
|
||||
* resultCallback: (result, configuration: INativeWindowConfiguration & NativeParsedArgs) => unknown,
|
||||
* options?: {
|
||||
* configureDeveloperSettings?: (config: INativeWindowConfiguration & NativeParsedArgs) => {
|
||||
* forceDisableShowDevtoolsOnError?: boolean,
|
||||
* forceEnableDeveloperKeybindings?: boolean,
|
||||
* disallowReloadKeybinding?: boolean,
|
||||
* removeDeveloperKeybindingsAfterLoad?: boolean
|
||||
* },
|
||||
* canModifyDOM?: (config: INativeWindowConfiguration & NativeParsedArgs) => void,
|
||||
* beforeLoaderConfig?: (loaderConfig: object) => void,
|
||||
* beforeRequire?: () => void
|
||||
* }
|
||||
* ) => Promise<unknown>
|
||||
* }}
|
||||
*/
|
||||
function bootstrapWindowLib() {
|
||||
// @ts-ignore (defined in bootstrap-window.js)
|
||||
return window.MonacoBootstrapWindow;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {INativeWindowConfiguration & NativeParsedArgs} configuration
|
||||
*/
|
||||
function showSplash(configuration) {
|
||||
performance.mark('code/willShowPartsSplash');
|
||||
|
||||
let data = configuration.partsSplash;
|
||||
|
||||
if (data) {
|
||||
// high contrast mode has been turned by the OS -> ignore stored colors and layouts
|
||||
if (configuration.autoDetectHighContrast && configuration.colorScheme.highContrast) {
|
||||
if ((configuration.colorScheme.dark && data.baseTheme !== 'hc-black') || (!configuration.colorScheme.dark && data.baseTheme !== 'hc-light')) {
|
||||
data = undefined;
|
||||
}
|
||||
} else if (configuration.autoDetectColorScheme) {
|
||||
// OS color scheme is tracked and has changed
|
||||
if ((configuration.colorScheme.dark && data.baseTheme !== 'vs-dark') || (!configuration.colorScheme.dark && data.baseTheme !== 'vs')) {
|
||||
data = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// developing an extension -> ignore stored layouts
|
||||
if (data && configuration.extensionDevelopmentPath) {
|
||||
data.layoutInfo = undefined;
|
||||
}
|
||||
|
||||
// minimal color configuration (works with or without persisted data)
|
||||
let baseTheme, shellBackground, shellForeground;
|
||||
if (data) {
|
||||
baseTheme = data.baseTheme;
|
||||
shellBackground = data.colorInfo.editorBackground;
|
||||
shellForeground = data.colorInfo.foreground;
|
||||
} else if (configuration.autoDetectHighContrast && configuration.colorScheme.highContrast) {
|
||||
if (configuration.colorScheme.dark) {
|
||||
baseTheme = 'hc-black';
|
||||
shellBackground = '#000000';
|
||||
shellForeground = '#FFFFFF';
|
||||
} else {
|
||||
baseTheme = 'hc-light';
|
||||
shellBackground = '#FFFFFF';
|
||||
shellForeground = '#000000';
|
||||
}
|
||||
} else if (configuration.autoDetectColorScheme) {
|
||||
if (configuration.colorScheme.dark) {
|
||||
baseTheme = 'vs-dark';
|
||||
shellBackground = '#1E1E1E';
|
||||
shellForeground = '#CCCCCC';
|
||||
} else {
|
||||
baseTheme = 'vs';
|
||||
shellBackground = '#FFFFFF';
|
||||
shellForeground = '#000000';
|
||||
}
|
||||
}
|
||||
|
||||
const style = document.createElement('style');
|
||||
style.className = 'initialShellColors';
|
||||
document.head.appendChild(style);
|
||||
style.textContent = `body { background-color: ${shellBackground}; color: ${shellForeground}; margin: 0; padding: 0; }`;
|
||||
|
||||
// restore parts if possible (we might not always store layout info)
|
||||
if (data?.layoutInfo) {
|
||||
const { layoutInfo, colorInfo } = data;
|
||||
|
||||
const splash = document.createElement('div');
|
||||
splash.id = 'monaco-parts-splash';
|
||||
splash.className = baseTheme;
|
||||
|
||||
if (layoutInfo.windowBorder) {
|
||||
splash.style.position = 'relative';
|
||||
splash.style.height = 'calc(100vh - 2px)';
|
||||
splash.style.width = 'calc(100vw - 2px)';
|
||||
splash.style.border = '1px solid var(--window-border-color)';
|
||||
splash.style.setProperty('--window-border-color', colorInfo.windowBorder);
|
||||
|
||||
if (layoutInfo.windowBorderRadius) {
|
||||
splash.style.borderRadius = layoutInfo.windowBorderRadius;
|
||||
}
|
||||
}
|
||||
|
||||
// ensure there is enough space
|
||||
layoutInfo.sideBarWidth = Math.min(layoutInfo.sideBarWidth, window.innerWidth - (layoutInfo.activityBarWidth + layoutInfo.editorPartMinWidth));
|
||||
|
||||
// part: title
|
||||
const titleDiv = document.createElement('div');
|
||||
titleDiv.setAttribute('style', `position: absolute; width: 100%; left: 0; top: 0; height: ${layoutInfo.titleBarHeight}px; background-color: ${colorInfo.titleBarBackground}; -webkit-app-region: drag;`);
|
||||
splash.appendChild(titleDiv);
|
||||
|
||||
// part: activity bar
|
||||
const activityDiv = document.createElement('div');
|
||||
activityDiv.setAttribute('style', `position: absolute; height: calc(100% - ${layoutInfo.titleBarHeight}px); top: ${layoutInfo.titleBarHeight}px; ${layoutInfo.sideBarSide}: 0; width: ${layoutInfo.activityBarWidth}px; background-color: ${colorInfo.activityBarBackground};`);
|
||||
splash.appendChild(activityDiv);
|
||||
|
||||
// part: side bar (only when opening workspace/folder)
|
||||
// folder or workspace -> status bar color, sidebar
|
||||
if (configuration.workspace) {
|
||||
const sideDiv = document.createElement('div');
|
||||
sideDiv.setAttribute('style', `position: absolute; height: calc(100% - ${layoutInfo.titleBarHeight}px); top: ${layoutInfo.titleBarHeight}px; ${layoutInfo.sideBarSide}: ${layoutInfo.activityBarWidth}px; width: ${layoutInfo.sideBarWidth}px; background-color: ${colorInfo.sideBarBackground};`);
|
||||
splash.appendChild(sideDiv);
|
||||
}
|
||||
|
||||
// part: statusbar
|
||||
const statusDiv = document.createElement('div');
|
||||
statusDiv.setAttribute('style', `position: absolute; width: 100%; bottom: 0; left: 0; height: ${layoutInfo.statusBarHeight}px; background-color: ${configuration.workspace ? colorInfo.statusBarBackground : colorInfo.statusBarNoFolderBackground};`);
|
||||
splash.appendChild(statusDiv);
|
||||
|
||||
document.body.appendChild(splash);
|
||||
}
|
||||
|
||||
performance.mark('code/didShowPartsSplash');
|
||||
}
|
||||
|
||||
//#endregion
|
||||
}());
|
||||
@@ -46,7 +46,7 @@ import { getResolvedShellEnv } from 'vs/platform/shell/node/shellEnv';
|
||||
import { IExtensionUrlTrustService } from 'vs/platform/extensionManagement/common/extensionUrlTrust';
|
||||
import { ExtensionUrlTrustService } from 'vs/platform/extensionManagement/node/extensionUrlTrustService';
|
||||
import { IExtensionHostStarter, ipcExtensionHostStarterChannelName } from 'vs/platform/extensions/common/extensionHostStarter';
|
||||
import { ExtensionHostStarter } from 'vs/platform/extensions/electron-main/extensionHostStarter';
|
||||
import { WorkerMainProcessExtensionHostStarter } from 'vs/platform/extensions/electron-main/workerMainProcessExtensionHostStarter';
|
||||
import { IExternalTerminalMainService } from 'vs/platform/externalTerminal/common/externalTerminal';
|
||||
import { LinuxExternalTerminalService, MacExternalTerminalService, WindowsExternalTerminalService } from 'vs/platform/externalTerminal/node/externalTerminalService';
|
||||
import { LOCAL_FILE_SYSTEM_CHANNEL_NAME } from 'vs/platform/files/common/diskFileSystemProviderClient';
|
||||
@@ -70,12 +70,12 @@ import { SharedProcess } from 'vs/platform/sharedProcess/electron-main/sharedPro
|
||||
import { ISignService } from 'vs/platform/sign/common/sign';
|
||||
import { IStateMainService } from 'vs/platform/state/electron-main/state';
|
||||
import { StorageDatabaseChannel } from 'vs/platform/storage/electron-main/storageIpc';
|
||||
import { ApplicationStorageMainService, IApplicationStorageMainService, IStorageMainService, StorageMainService } from 'vs/platform/storage/electron-main/storageMainService';
|
||||
import { GlobalStorageMainService, IGlobalStorageMainService, IStorageMainService, StorageMainService } from 'vs/platform/storage/electron-main/storageMainService';
|
||||
import { resolveCommonProperties } from 'vs/platform/telemetry/common/commonProperties';
|
||||
import { ITelemetryService, machineIdKey, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { TelemetryAppenderClient } from 'vs/platform/telemetry/common/telemetryIpc';
|
||||
import { ITelemetryServiceConfig, TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
|
||||
import { getPiiPathsFromEnvironment, getTelemetryLevel, isInternalTelemetry, NullTelemetryService, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { getPiiPathsFromEnvironment, getTelemetryLevel, NullTelemetryService, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { IUpdateService } from 'vs/platform/update/common/update';
|
||||
import { UpdateChannel } from 'vs/platform/update/common/updateIpc';
|
||||
import { DarwinUpdateService } from 'vs/platform/update/electron-main/updateService.darwin';
|
||||
@@ -99,13 +99,6 @@ import { IWorkspacesHistoryMainService, WorkspacesHistoryMainService } from 'vs/
|
||||
import { WorkspacesMainService } from 'vs/platform/workspaces/electron-main/workspacesMainService';
|
||||
import { IWorkspacesManagementMainService, WorkspacesManagementMainService } from 'vs/platform/workspaces/electron-main/workspacesManagementMainService';
|
||||
import { CredentialsNativeMainService } from 'vs/platform/credentials/electron-main/credentialsMainService';
|
||||
import { IPolicyService } from 'vs/platform/policy/common/policy';
|
||||
import { PolicyChannel } from 'vs/platform/policy/common/policyIpc';
|
||||
import { IUserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile';
|
||||
import { IDefaultExtensionsProfileInitService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { DefaultExtensionsProfileInitHandler } from 'vs/platform/extensionManagement/electron-main/defaultExtensionsProfileInit';
|
||||
import { RequestChannel } from 'vs/platform/request/common/requestIpc';
|
||||
import { IRequestService } from 'vs/platform/request/common/request';
|
||||
|
||||
/**
|
||||
* The main VS Code application. There will only ever be one instance,
|
||||
@@ -270,7 +263,7 @@ export class CodeApplication extends Disposable {
|
||||
|
||||
// remote extension schemes have the following format
|
||||
// http://127.0.0.1:<port>/vscode-remote-resource?path=
|
||||
if (!uri.path.endsWith(Schemas.vscodeRemoteResource) && contentTypes.some(contentType => contentType.toLowerCase().includes('image/svg'))) {
|
||||
if (!uri.path.includes(Schemas.vscodeRemoteResource) && contentTypes.some(contentType => contentType.toLowerCase().includes('image/svg'))) {
|
||||
return callback({ cancel: !isSvgRequestFromSafeContext(details) });
|
||||
}
|
||||
}
|
||||
@@ -529,9 +522,6 @@ export class CodeApplication extends Disposable {
|
||||
// Services
|
||||
const appInstantiationService = await this.initServices(machineId, sharedProcess, sharedProcessReady);
|
||||
|
||||
// Setup Handlers
|
||||
this.setUpHandlers(appInstantiationService);
|
||||
|
||||
// Setup Auth Handler
|
||||
this._register(appInstantiationService.createInstance(<any>ProxyAuthHandler)); // {{SQL CARBON EDIT}} Cast here to avoid compilation error (not finding constructor?)
|
||||
|
||||
@@ -550,14 +540,6 @@ export class CodeApplication extends Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
private setUpHandlers(instantiationService: IInstantiationService): void {
|
||||
// Auth Handler
|
||||
this._register(instantiationService.createInstance(ProxyAuthHandler));
|
||||
|
||||
// Default Extensions Profile Init Handler
|
||||
this._register(instantiationService.createInstance(DefaultExtensionsProfileInitHandler));
|
||||
}
|
||||
|
||||
private async resolveMachineId(): Promise<string> {
|
||||
|
||||
// We cache the machineId for faster lookups on startup
|
||||
@@ -659,11 +641,11 @@ export class CodeApplication extends Disposable {
|
||||
services.set(IExtensionUrlTrustService, new SyncDescriptor(ExtensionUrlTrustService));
|
||||
|
||||
// Extension Host Starter
|
||||
services.set(IExtensionHostStarter, new SyncDescriptor(ExtensionHostStarter));
|
||||
services.set(IExtensionHostStarter, new SyncDescriptor(WorkerMainProcessExtensionHostStarter));
|
||||
|
||||
// Storage
|
||||
services.set(IStorageMainService, new SyncDescriptor(StorageMainService));
|
||||
services.set(IApplicationStorageMainService, new SyncDescriptor(ApplicationStorageMainService));
|
||||
services.set(IGlobalStorageMainService, new SyncDescriptor(GlobalStorageMainService));
|
||||
|
||||
// External terminal
|
||||
if (isWindows) {
|
||||
@@ -683,10 +665,9 @@ export class CodeApplication extends Disposable {
|
||||
|
||||
// Telemetry
|
||||
if (supportsTelemetry(this.productService, this.environmentMainService)) {
|
||||
const isInternal = isInternalTelemetry(this.productService, this.configurationService);
|
||||
const channel = getDelayedChannel(sharedProcessReady.then(client => client.getChannel('telemetryAppender')));
|
||||
const appender = new TelemetryAppenderClient(channel);
|
||||
const commonProperties = resolveCommonProperties(this.fileService, release(), hostname(), process.arch, this.productService.commit, this.productService.version, machineId, isInternal, this.environmentMainService.installSourcePath);
|
||||
const commonProperties = resolveCommonProperties(this.fileService, release(), hostname(), process.arch, this.productService.commit, this.productService.version, machineId, this.productService.msftInternalDomains, this.environmentMainService.installSourcePath);
|
||||
const piiPaths = getPiiPathsFromEnvironment(this.environmentMainService);
|
||||
const config: ITelemetryServiceConfig = { appenders: [appender], commonProperties, piiPaths, sendErrorTelemetry: true };
|
||||
|
||||
@@ -695,9 +676,6 @@ export class CodeApplication extends Disposable {
|
||||
services.set(ITelemetryService, NullTelemetryService);
|
||||
}
|
||||
|
||||
// Default Extensions Profile Init
|
||||
services.set(IDefaultExtensionsProfileInitService, ProxyChannel.toService(getDelayedChannel(sharedProcessReady.then(client => client.getChannel('IDefaultExtensionsProfileInitService')))));
|
||||
|
||||
// Init services that require it
|
||||
await backupMainService.initialize();
|
||||
|
||||
@@ -717,11 +695,6 @@ export class CodeApplication extends Disposable {
|
||||
const diagnosticsChannel = ProxyChannel.fromService(accessor.get(IDiagnosticsMainService), { disableMarshalling: true });
|
||||
this.mainProcessNodeIpcServer.registerChannel('diagnostics', diagnosticsChannel);
|
||||
|
||||
// Policies (main & shared process)
|
||||
const policyChannel = new PolicyChannel(accessor.get(IPolicyService));
|
||||
mainProcessElectronServer.registerChannel('policy', policyChannel);
|
||||
sharedProcessClient.then(client => client.registerChannel('policy', policyChannel));
|
||||
|
||||
// Local Files
|
||||
const diskFileSystemProvider = this.fileService.getProvider(Schemas.file);
|
||||
assertType(diskFileSystemProvider instanceof DiskFileSystemProvider);
|
||||
@@ -729,15 +702,6 @@ export class CodeApplication extends Disposable {
|
||||
mainProcessElectronServer.registerChannel(LOCAL_FILE_SYSTEM_CHANNEL_NAME, fileSystemProviderChannel);
|
||||
sharedProcessClient.then(client => client.registerChannel(LOCAL_FILE_SYSTEM_CHANNEL_NAME, fileSystemProviderChannel));
|
||||
|
||||
// User Data Profiles
|
||||
const userDataProfilesService = ProxyChannel.fromService(accessor.get(IUserDataProfilesMainService));
|
||||
mainProcessElectronServer.registerChannel('userDataProfiles', userDataProfilesService);
|
||||
sharedProcessClient.then(client => client.registerChannel('userDataProfiles', userDataProfilesService));
|
||||
|
||||
// Request
|
||||
const requestService = new RequestChannel(accessor.get(IRequestService));
|
||||
sharedProcessClient.then(client => client.registerChannel('request', requestService));
|
||||
|
||||
// Update
|
||||
const updateChannel = new UpdateChannel(accessor.get(IUpdateService));
|
||||
mainProcessElectronServer.registerChannel('update', updateChannel);
|
||||
@@ -900,13 +864,6 @@ export class CodeApplication extends Disposable {
|
||||
// or if no window is open (macOS only)
|
||||
shouldOpenInNewWindow ||= isMacintosh && windowsMainService.getWindowCount() === 0;
|
||||
|
||||
// Pass along edit session id
|
||||
if (params.get('editSessionId') !== null) {
|
||||
environmentService.editSessionId = params.get('editSessionId') ?? undefined;
|
||||
params.delete('editSessionId');
|
||||
uri = uri.with({ query: params.toString() });
|
||||
}
|
||||
|
||||
// Check for URIs to open in window
|
||||
const windowOpenableFromProtocolLink = app.getWindowOpenableFromProtocolLink(uri);
|
||||
logService.trace('app#handleURL: windowOpenableFromProtocolLink = ', windowOpenableFromProtocolLink);
|
||||
@@ -1016,7 +973,6 @@ export class CodeApplication extends Disposable {
|
||||
cli: args,
|
||||
forceNewWindow: args['new-window'] || (!hasCliArgs && args['unity-launch']),
|
||||
diffMode: args.diff,
|
||||
mergeMode: args.merge,
|
||||
noRecentEntry,
|
||||
waitMarkerFileURI,
|
||||
gotoLineMode: args.goto,
|
||||
@@ -1142,7 +1098,7 @@ export class CodeApplication extends Disposable {
|
||||
code: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'The type of shared process crash to understand the nature of the crash better.' };
|
||||
visible: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Whether shared process window was visible or not.' };
|
||||
shuttingdown: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Whether the application is shutting down when the crash happens.' };
|
||||
owner: 'bpasero';
|
||||
owner: 'bpaser';
|
||||
comment: 'Event which fires whenever an error occurs in the shared process';
|
||||
|
||||
};
|
||||
|
||||
@@ -62,14 +62,6 @@ import { IStateMainService } from 'vs/platform/state/electron-main/state';
|
||||
import { StateMainService } from 'vs/platform/state/electron-main/stateMainService';
|
||||
import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { IThemeMainService, ThemeMainService } from 'vs/platform/theme/electron-main/themeMainService';
|
||||
import { IUserDataProfilesMainService, UserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile';
|
||||
import { IPolicyService, NullPolicyService } from 'vs/platform/policy/common/policy';
|
||||
import { NativePolicyService } from 'vs/platform/policy/node/nativePolicyService';
|
||||
import { FilePolicyService } from 'vs/platform/policy/common/filePolicyService';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
|
||||
import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService';
|
||||
import { PROFILES_ENABLEMENT_CONFIG } from 'vs/platform/userDataProfile/common/userDataProfile';
|
||||
|
||||
/**
|
||||
* The main VS Code entry point.
|
||||
@@ -97,13 +89,13 @@ class CodeMain {
|
||||
setUnexpectedErrorHandler(err => console.error(err));
|
||||
|
||||
// Create services
|
||||
const [instantiationService, instanceEnvironment, environmentMainService, configurationService, stateMainService, bufferLogService, productService, userDataProfilesMainService] = this.createServices();
|
||||
const [instantiationService, instanceEnvironment, environmentMainService, configurationService, stateMainService, bufferLogService, productService] = this.createServices();
|
||||
|
||||
try {
|
||||
|
||||
// Init services
|
||||
try {
|
||||
await this.initServices(environmentMainService, userDataProfilesMainService, configurationService, stateMainService);
|
||||
await this.initServices(environmentMainService, configurationService, stateMainService);
|
||||
} catch (error) {
|
||||
|
||||
// Show a dialog for errors that can be resolved by the user
|
||||
@@ -145,10 +137,8 @@ class CodeMain {
|
||||
}
|
||||
}
|
||||
|
||||
private createServices(): [IInstantiationService, IProcessEnvironment, IEnvironmentMainService, ConfigurationService, StateMainService, BufferLogService, IProductService, UserDataProfilesMainService] {
|
||||
private createServices(): [IInstantiationService, IProcessEnvironment, IEnvironmentMainService, ConfigurationService, StateMainService, BufferLogService, IProductService] {
|
||||
const services = new ServiceCollection();
|
||||
const disposables = new DisposableStore();
|
||||
process.once('exit', () => disposables.dispose());
|
||||
|
||||
// Product
|
||||
const productService = { _serviceBrand: undefined, ...product };
|
||||
@@ -163,7 +153,8 @@ class CodeMain {
|
||||
// we are the only instance running, otherwise we'll have concurrent
|
||||
// log file access on Windows (https://github.com/microsoft/vscode/issues/41218)
|
||||
const bufferLogService = new BufferLogService();
|
||||
const logService = disposables.add(new MultiplexLogService([new ConsoleMainLogger(getLogLevel(environmentMainService)), bufferLogService]));
|
||||
const logService = new MultiplexLogService([new ConsoleMainLogger(getLogLevel(environmentMainService)), bufferLogService]);
|
||||
process.once('exit', () => logService.dispose());
|
||||
services.set(ILogService, logService);
|
||||
|
||||
// Files
|
||||
@@ -172,34 +163,20 @@ class CodeMain {
|
||||
const diskFileSystemProvider = new DiskFileSystemProvider(logService);
|
||||
fileService.registerProvider(Schemas.file, diskFileSystemProvider);
|
||||
|
||||
// URI Identity
|
||||
const uriIdentityService = new UriIdentityService(fileService);
|
||||
services.set(IUriIdentityService, uriIdentityService);
|
||||
|
||||
// Logger
|
||||
services.set(ILoggerService, new LoggerService(logService, fileService));
|
||||
|
||||
// State
|
||||
const stateMainService = new StateMainService(environmentMainService, logService, fileService);
|
||||
services.set(IStateMainService, stateMainService);
|
||||
|
||||
// User Data Profiles
|
||||
const userDataProfilesMainService = new UserDataProfilesMainService(stateMainService, uriIdentityService, environmentMainService, fileService, logService);
|
||||
services.set(IUserDataProfilesMainService, userDataProfilesMainService);
|
||||
|
||||
// Policy
|
||||
const policyService = isWindows && productService.win32RegValueName ? disposables.add(new NativePolicyService(productService.win32RegValueName))
|
||||
: environmentMainService.policyFile ? disposables.add(new FilePolicyService(environmentMainService.policyFile, fileService, logService))
|
||||
: new NullPolicyService();
|
||||
services.set(IPolicyService, policyService);
|
||||
|
||||
// Configuration
|
||||
const configurationService = new ConfigurationService(userDataProfilesMainService.defaultProfile.settingsResource, fileService, policyService, logService);
|
||||
const configurationService = new ConfigurationService(environmentMainService.settingsResource, fileService);
|
||||
services.set(IConfigurationService, configurationService);
|
||||
|
||||
// Lifecycle
|
||||
services.set(ILifecycleMainService, new SyncDescriptor(LifecycleMainService));
|
||||
|
||||
// State
|
||||
const stateMainService = new StateMainService(environmentMainService, logService, fileService);
|
||||
services.set(IStateMainService, stateMainService);
|
||||
|
||||
// Request
|
||||
services.set(IRequestService, new SyncDescriptor(RequestMainService));
|
||||
|
||||
@@ -215,7 +192,7 @@ class CodeMain {
|
||||
// Protocol
|
||||
services.set(IProtocolMainService, new SyncDescriptor(ProtocolMainService));
|
||||
|
||||
return [new InstantiationService(services, true), instanceEnvironment, environmentMainService, configurationService, stateMainService, bufferLogService, productService, userDataProfilesMainService];
|
||||
return [new InstantiationService(services, true), instanceEnvironment, environmentMainService, configurationService, stateMainService, bufferLogService, productService];
|
||||
}
|
||||
|
||||
private patchEnvironment(environmentMainService: IEnvironmentMainService): IProcessEnvironment {
|
||||
@@ -235,28 +212,26 @@ class CodeMain {
|
||||
return instanceEnvironment;
|
||||
}
|
||||
|
||||
private async initServices(environmentMainService: IEnvironmentMainService, userDataProfilesMainService: UserDataProfilesMainService, configurationService: ConfigurationService, stateMainService: StateMainService): Promise<void> {
|
||||
await Promises.settled<unknown>([
|
||||
private initServices(environmentMainService: IEnvironmentMainService, configurationService: ConfigurationService, stateMainService: StateMainService): Promise<unknown> {
|
||||
return Promises.settled<unknown>([
|
||||
|
||||
// Environment service (paths)
|
||||
Promise.all<string | undefined>([
|
||||
environmentMainService.extensionsPath,
|
||||
environmentMainService.codeCachePath,
|
||||
environmentMainService.logsPath,
|
||||
userDataProfilesMainService.defaultProfile.globalStorageHome.fsPath,
|
||||
environmentMainService.globalStorageHome.fsPath,
|
||||
environmentMainService.workspaceStorageHome.fsPath,
|
||||
environmentMainService.localHistoryHome.fsPath,
|
||||
environmentMainService.backupHome
|
||||
].map(path => path ? FSPromises.mkdir(path, { recursive: true }) : undefined)),
|
||||
|
||||
// State service
|
||||
stateMainService.init(),
|
||||
|
||||
// Configuration service
|
||||
configurationService.initialize()
|
||||
]);
|
||||
configurationService.initialize(),
|
||||
|
||||
userDataProfilesMainService.setEnablement(!!configurationService.getValue(PROFILES_ENABLEMENT_CONFIG));
|
||||
// State service
|
||||
stateMainService.init()
|
||||
]);
|
||||
}
|
||||
|
||||
private async claimInstance(logService: ILogService, environmentMainService: IEnvironmentMainService, lifecycleMainService: ILifecycleMainService, instantiationService: IInstantiationService, productService: IProductService, retry: boolean): Promise<NodeIPCServer> {
|
||||
|
||||
@@ -142,7 +142,6 @@ export class IssueReporter extends Disposable {
|
||||
this.updateExperimentsInfo(configuration.data.experiments);
|
||||
this.updateRestrictedMode(configuration.data.restrictedMode);
|
||||
this.updatePreviewFeaturesEnabled(configuration.data.previewFeaturesEnabled); // {{SQL CARBON EDIT}} Add preview features flag
|
||||
this.updateUnsupportedMode(configuration.data.isUnsupported);
|
||||
}
|
||||
|
||||
render(): void {
|
||||
@@ -1162,10 +1161,6 @@ export class IssueReporter extends Disposable {
|
||||
this.issueReporterModel.update({ previewFeaturesEnabled });
|
||||
}
|
||||
|
||||
private updateUnsupportedMode(isUnsupported: boolean) {
|
||||
this.issueReporterModel.update({ isUnsupported });
|
||||
}
|
||||
|
||||
private updateExperimentsInfo(experimentInfo: string | undefined) {
|
||||
this.issueReporterModel.update({ experimentInfo });
|
||||
const target = document.querySelector<HTMLElement>('.block-experiments .block-info');
|
||||
@@ -1209,15 +1204,21 @@ export class IssueReporter extends Disposable {
|
||||
|
||||
private addEventListener(elementId: string, eventType: string, handler: (event: Event) => void): void {
|
||||
const element = this.getElementById(elementId);
|
||||
element?.addEventListener(eventType, handler);
|
||||
if (element) {
|
||||
element.addEventListener(eventType, handler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// helper functions
|
||||
|
||||
function hide(el: Element | undefined | null) {
|
||||
el?.classList.add('hidden');
|
||||
if (el) {
|
||||
el.classList.add('hidden');
|
||||
}
|
||||
}
|
||||
function show(el: Element | undefined | null) {
|
||||
el?.classList.remove('hidden');
|
||||
if (el) {
|
||||
el.classList.remove('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ export interface IssueReporterData {
|
||||
experimentInfo?: string;
|
||||
restrictedMode?: boolean;
|
||||
previewFeaturesEnabled?: boolean; // {{SQL CARBON EDIT}} Add preview features flag
|
||||
isUnsupported?: boolean;
|
||||
}
|
||||
|
||||
export class IssueReporterModel {
|
||||
@@ -64,15 +63,8 @@ export class IssueReporterModel {
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
serialize(): string {
|
||||
const modes = [];
|
||||
if (this._data.restrictedMode) {
|
||||
modes.push('Restricted');
|
||||
}
|
||||
if (this._data.isUnsupported) {
|
||||
modes.push('Unsupported');
|
||||
}
|
||||
return `
|
||||
Type: <b>${this.getIssueTypeTitle()}</b>
|
||||
Issue Type: <b>${this.getIssueTypeTitle()}</b>
|
||||
|
||||
${this._data.issueDescription}
|
||||
${this.getExtensionVersion()}
|
||||
@@ -80,7 +72,6 @@ Azure Data Studio version: ${this._data.versionInfo && this._data.versionInfo.vs
|
||||
OS version: ${this._data.versionInfo && this._data.versionInfo.os}
|
||||
Restricted Mode: ${this._data.restrictedMode ? 'Yes' : 'No'}
|
||||
Preview Features: ${this._data.previewFeaturesEnabled ? 'Enabled' : 'Disabled'}
|
||||
Modes:${modes.length ? ' ' + modes.join(', ') : ''}
|
||||
${this.getRemoteOSes()}
|
||||
${this.getInfos()}
|
||||
<!-- generated by issue reporter -->`;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self' https: data: blob: vscode-remote-resource:; media-src 'self'; frame-src 'self' vscode-webview:; object-src 'self'; script-src 'self' 'unsafe-eval' blob:; style-src 'self' 'unsafe-inline'; connect-src 'self' https: ws:; font-src 'self' https: vscode-remote-resource:;">
|
||||
<!-- <meta http-equiv="Content-Security-Policy" content="require-trusted-types-for 'script'; trusted-types amdLoader cellRendererEditorText defaultWorkerFactory diffEditorWidget stickyScrollViewLayer editorGhostText domLineBreaksComputer editorViewLayer diffReview dompurify notebookRenderer safeInnerHtml standaloneColorizer tokenizeToString;"> -->
|
||||
<!-- <meta http-equiv="Content-Security-Policy" content="require-trusted-types-for 'script'; trusted-types amdLoader cellRendererEditorText defaultWorkerFactory diffEditorWidget editorGhostText domLineBreaksComputer editorViewLayer diffReview dompurify notebookRenderer safeInnerHtml standaloneColorizer tokenizeToString;"> -->
|
||||
</head>
|
||||
<body aria-label="">
|
||||
</body>
|
||||
|
||||
@@ -16,11 +16,10 @@
|
||||
|
||||
// Load workbench main JS, CSS and NLS all in parallel. This is an
|
||||
// optimization to prevent a waterfall of loading to happen, because
|
||||
// we know for a fact that workbench.desktop.main will depend on
|
||||
// we know for a fact that workbench.desktop.sandbox.main will depend on
|
||||
// the related CSS and NLS counterparts.
|
||||
bootstrapWindow.load([
|
||||
'sql/setup', // {{SQL CARBON EDIT}}
|
||||
'vs/workbench/workbench.desktop.main',
|
||||
'vs/workbench/workbench.desktop.sandbox.main',
|
||||
'vs/nls!vs/workbench/workbench.desktop.main',
|
||||
'vs/css!vs/workbench/workbench.desktop.main'
|
||||
],
|
||||
@@ -62,7 +61,7 @@
|
||||
window.requestIdleCallback(() => {
|
||||
const canvas = document.createElement('canvas');
|
||||
const context = canvas.getContext('2d');
|
||||
context?.clearRect(0, 0, canvas.width, canvas.height);
|
||||
context.clearRect(0, 0, canvas.width, canvas.height);
|
||||
canvas.remove();
|
||||
}, { timeout: 50 });
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { chmodSync, existsSync, readFileSync, statSync, truncateSync, unlinkSync
|
||||
import { homedir, release, tmpdir } from 'os';
|
||||
import type { ProfilingSession, Target } from 'v8-inspect-profiler';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { isAbsolute, resolve, join } from 'vs/base/common/path';
|
||||
import { isAbsolute, resolve } from 'vs/base/common/path';
|
||||
import { IProcessEnvironment, isMacintosh, isWindows } from 'vs/base/common/platform';
|
||||
import { randomPort } from 'vs/base/common/ports';
|
||||
import { isString } from 'vs/base/common/types';
|
||||
@@ -24,8 +24,6 @@ import product from 'vs/platform/product/common/product';
|
||||
import { CancellationTokenSource } from 'vs/base/common/cancellation';
|
||||
import { randomPath } from 'vs/base/common/extpath';
|
||||
import { Utils } from 'vs/platform/profiling/common/profiling';
|
||||
import { dirname } from 'vs/base/common/resources';
|
||||
import { FileAccess } from 'vs/base/common/network';
|
||||
|
||||
function shouldSpawnCliProcess(argv: NativeParsedArgs): boolean {
|
||||
return !!argv['install-source']
|
||||
@@ -61,21 +59,6 @@ export async function main(argv: string[]): Promise<any> {
|
||||
console.log(buildVersionMessage(product.version, product.commit));
|
||||
}
|
||||
|
||||
// Shell integration
|
||||
else if (args['locate-shell-integration-path']) {
|
||||
let file: string;
|
||||
switch (args['locate-shell-integration-path']) {
|
||||
// Usage: `[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path bash)"`
|
||||
case 'bash': file = 'shellIntegration-bash.sh'; break;
|
||||
// Usage: `if ($env:TERM_PROGRAM -eq "vscode") { . "$(code --locate-shell-integration-path pwsh)" }`
|
||||
case 'pwsh': file = 'shellIntegration.ps1'; break;
|
||||
// Usage: `[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path zsh)"`
|
||||
case 'zsh': file = 'shellIntegration-rc.zsh'; break;
|
||||
default: throw new Error('Error using --locate-shell-integration-path: Invalid shell type');
|
||||
}
|
||||
console.log(join(dirname(FileAccess.asFileUri('', require)).fsPath, 'out', 'vs', 'workbench', 'contrib', 'terminal', 'browser', 'media', file));
|
||||
}
|
||||
|
||||
// Extensions Management
|
||||
else if (shouldSpawnCliProcess(args)) {
|
||||
const cli = await new Promise<IMainCli>((resolve, reject) => require(['vs/code/node/cliProcessMain'], resolve, reject));
|
||||
@@ -303,7 +286,7 @@ export async function main(argv: string[]): Promise<any> {
|
||||
return;
|
||||
}
|
||||
let suffix = '';
|
||||
const result = await session.stop();
|
||||
let result = await session.stop();
|
||||
if (!process.env['VSCODE_DEV']) {
|
||||
// when running from a not-development-build we remove
|
||||
// absolute filenames because we don't want to reveal anything
|
||||
|
||||
@@ -11,8 +11,8 @@ import { onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/err
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { isAbsolute, join } from 'vs/base/common/path';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
import { cwd } from 'vs/base/common/process';
|
||||
import { joinPath } from 'vs/base/common/resources';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Promises } from 'vs/base/node/pfs';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
@@ -23,11 +23,10 @@ import { NativeParsedArgs } from 'vs/platform/environment/common/argv';
|
||||
import { INativeEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { NativeEnvironmentService } from 'vs/platform/environment/node/environmentService';
|
||||
import { ExtensionGalleryServiceWithNoStorageService } from 'vs/platform/extensionManagement/common/extensionGalleryService';
|
||||
import { IExtensionGalleryService, IExtensionManagementCLIService, InstallOptions } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { IExtensionGalleryService, IExtensionManagementCLIService, IExtensionManagementService, InstallOptions } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionManagementCLIService } from 'vs/platform/extensionManagement/common/extensionManagementCLIService';
|
||||
import { ExtensionsProfileScannerService, IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService';
|
||||
import { IExtensionsScannerService } from 'vs/platform/extensionManagement/common/extensionsScannerService';
|
||||
import { ExtensionManagementService, INativeServerExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService';
|
||||
import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService';
|
||||
import { ExtensionsScannerService } from 'vs/platform/extensionManagement/node/extensionsScannerService';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { FileService } from 'vs/platform/files/common/fileService';
|
||||
@@ -36,29 +35,22 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks';
|
||||
import { NativeLanguagePackService } from 'vs/platform/languagePacks/node/languagePacks';
|
||||
import { ILocalizationsService } from 'vs/platform/localizations/common/localizations';
|
||||
import { LocalizationsService } from 'vs/platform/localizations/node/localizations';
|
||||
import { ConsoleLogger, getLogLevel, ILogger, ILogService, LogLevel, MultiplexLogService } from 'vs/platform/log/common/log';
|
||||
import { SpdLogLogger } from 'vs/platform/log/node/spdlogLog';
|
||||
import { FilePolicyService } from 'vs/platform/policy/common/filePolicyService';
|
||||
import { IPolicyService, NullPolicyService } from 'vs/platform/policy/common/policy';
|
||||
import { NativePolicyService } from 'vs/platform/policy/node/nativePolicyService';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { IRequestService } from 'vs/platform/request/common/request';
|
||||
import { RequestService } from 'vs/platform/request/node/requestService';
|
||||
import { IStateService } from 'vs/platform/state/node/state';
|
||||
import { StateService } from 'vs/platform/state/node/stateService';
|
||||
import { resolveCommonProperties } from 'vs/platform/telemetry/common/commonProperties';
|
||||
import { ITelemetryService, machineIdKey } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { ITelemetryServiceConfig, TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
|
||||
import { supportsTelemetry, NullTelemetryService, getPiiPathsFromEnvironment, isInternalTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { supportsTelemetry, NullTelemetryService, isInternalTelemetry, getPiiPathsFromEnvironment } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
|
||||
import { buildTelemetryMessage } from 'vs/platform/telemetry/node/telemetry';
|
||||
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
|
||||
import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService';
|
||||
import { IUserDataProfilesService, PROFILES_ENABLEMENT_CONFIG } from 'vs/platform/userDataProfile/common/userDataProfile';
|
||||
import { UserDataProfilesService } from 'vs/platform/userDataProfile/node/userDataProfile';
|
||||
|
||||
class CliMain extends Disposable {
|
||||
|
||||
@@ -136,35 +128,12 @@ class CliMain extends Disposable {
|
||||
const diskFileSystemProvider = this._register(new DiskFileSystemProvider(logService));
|
||||
fileService.registerProvider(Schemas.file, diskFileSystemProvider);
|
||||
|
||||
// State
|
||||
const stateService = new StateService(environmentService, logService, fileService);
|
||||
services.set(IStateService, stateService);
|
||||
|
||||
// Uri Identity
|
||||
const uriIdentityService = new UriIdentityService(fileService);
|
||||
services.set(IUriIdentityService, uriIdentityService);
|
||||
|
||||
// User Data Profiles
|
||||
const userDataProfilesService = new UserDataProfilesService(stateService, uriIdentityService, environmentService, fileService, logService);
|
||||
services.set(IUserDataProfilesService, userDataProfilesService);
|
||||
|
||||
// Policy
|
||||
const policyService = isWindows && productService.win32RegValueName ? this._register(new NativePolicyService(productService.win32RegValueName))
|
||||
: environmentService.policyFile ? this._register(new FilePolicyService(environmentService.policyFile, fileService, logService))
|
||||
: new NullPolicyService();
|
||||
services.set(IPolicyService, policyService);
|
||||
|
||||
// Configuration
|
||||
const configurationService = this._register(new ConfigurationService(userDataProfilesService.defaultProfile.settingsResource, fileService, policyService, logService));
|
||||
const configurationService = this._register(new ConfigurationService(environmentService.settingsResource, fileService));
|
||||
services.set(IConfigurationService, configurationService);
|
||||
|
||||
// Initialize
|
||||
await Promise.all([
|
||||
stateService.init(),
|
||||
configurationService.initialize()
|
||||
]);
|
||||
|
||||
userDataProfilesService.setEnablement(!!configurationService.getValue(PROFILES_ENABLEMENT_CONFIG));
|
||||
// Init config
|
||||
await configurationService.initialize();
|
||||
|
||||
// URI Identity
|
||||
services.set(IUriIdentityService, new UriIdentityService(fileService));
|
||||
@@ -176,14 +145,13 @@ class CliMain extends Disposable {
|
||||
services.set(IDownloadService, new SyncDescriptor(DownloadService));
|
||||
|
||||
// Extensions
|
||||
services.set(IExtensionsProfileScannerService, new SyncDescriptor(ExtensionsProfileScannerService));
|
||||
services.set(IExtensionsScannerService, new SyncDescriptor(ExtensionsScannerService));
|
||||
services.set(INativeServerExtensionManagementService, new SyncDescriptor(ExtensionManagementService));
|
||||
services.set(IExtensionManagementService, new SyncDescriptor(ExtensionManagementService));
|
||||
services.set(IExtensionGalleryService, new SyncDescriptor(ExtensionGalleryServiceWithNoStorageService));
|
||||
services.set(IExtensionManagementCLIService, new SyncDescriptor(ExtensionManagementCLIService));
|
||||
|
||||
// Localizations
|
||||
services.set(ILanguagePackService, new SyncDescriptor(NativeLanguagePackService));
|
||||
services.set(ILocalizationsService, new SyncDescriptor(LocalizationsService));
|
||||
|
||||
// Telemetry
|
||||
const appenders: OneDataSystemAppender[] = [];
|
||||
@@ -201,7 +169,7 @@ class CliMain extends Disposable {
|
||||
commonProperties: (async () => {
|
||||
let machineId: string | undefined = undefined;
|
||||
try {
|
||||
const storageContents = await Promises.readFile(environmentService.stateResource.fsPath);
|
||||
const storageContents = await Promises.readFile(joinPath(environmentService.globalStorageHome, 'storage.json').fsPath);
|
||||
machineId = JSON.parse(storageContents.toString())[machineIdKey];
|
||||
} catch (error) {
|
||||
if (error.code !== 'ENOENT') {
|
||||
@@ -209,7 +177,7 @@ class CliMain extends Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
return resolveCommonProperties(fileService, release(), hostname(), process.arch, productService.commit, productService.version, machineId, isInternal, installSourcePath);
|
||||
return resolveCommonProperties(fileService, release(), hostname(), process.arch, productService.commit, productService.version, machineId, productService.msftInternalDomains, installSourcePath);
|
||||
})(),
|
||||
piiPaths: getPiiPathsFromEnvironment(environmentService)
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ suite('IssueReporter', () => {
|
||||
const issueReporterModel = new IssueReporterModel({});
|
||||
assert.strictEqual(issueReporterModel.serialize(),
|
||||
`
|
||||
Type: <b>Bug</b>
|
||||
Issue Type: <b>Bug</b>
|
||||
|
||||
undefined
|
||||
|
||||
@@ -35,7 +35,6 @@ Azure Data Studio version: undefined
|
||||
OS version: undefined
|
||||
Restricted Mode: No
|
||||
Preview Features: Disabled
|
||||
Modes:
|
||||
|
||||
Extensions: none
|
||||
<!-- generated by issue reporter -->`);
|
||||
@@ -60,7 +59,7 @@ Extensions: none
|
||||
});
|
||||
assert.strictEqual(issueReporterModel.serialize(),
|
||||
`
|
||||
Type: <b>Bug</b>
|
||||
Issue Type: <b>Bug</b>
|
||||
|
||||
undefined
|
||||
|
||||
@@ -68,7 +67,6 @@ Azure Data Studio version: undefined
|
||||
OS version: undefined
|
||||
Restricted Mode: No
|
||||
Preview Features: Disabled
|
||||
Modes:
|
||||
|
||||
<details>
|
||||
<summary>System Info</summary>
|
||||
@@ -106,13 +104,13 @@ Modes:
|
||||
});
|
||||
assert.strictEqual(issueReporterModel.serialize(),
|
||||
`
|
||||
Type: <b>Bug</b>
|
||||
Issue Type: <b>Bug</b>
|
||||
|
||||
undefined
|
||||
|
||||
VS Code version: undefined
|
||||
OS version: undefined
|
||||
Modes:
|
||||
Restricted Mode: No
|
||||
|
||||
<details>
|
||||
<summary>System Info</summary>
|
||||
@@ -161,13 +159,13 @@ vsins829:30139715
|
||||
});
|
||||
assert.strictEqual(issueReporterModel.serialize(),
|
||||
`
|
||||
Type: <b>Bug</b>
|
||||
Issue Type: <b>Bug</b>
|
||||
|
||||
undefined
|
||||
|
||||
VS Code version: undefined
|
||||
OS version: undefined
|
||||
Modes:
|
||||
Restricted Mode: No
|
||||
|
||||
<details>
|
||||
<summary>System Info</summary>
|
||||
@@ -218,13 +216,13 @@ Modes:
|
||||
});
|
||||
assert.strictEqual(issueReporterModel.serialize(),
|
||||
`
|
||||
Type: <b>Bug</b>
|
||||
Issue Type: <b>Bug</b>
|
||||
|
||||
undefined
|
||||
|
||||
VS Code version: undefined
|
||||
OS version: undefined
|
||||
Modes:
|
||||
Restricted Mode: No
|
||||
Remote OS version: Linux x64 4.18.0
|
||||
|
||||
<details>
|
||||
@@ -267,13 +265,13 @@ Remote OS version: Linux x64 4.18.0
|
||||
});
|
||||
assert.strictEqual(issueReporterModel.serialize(),
|
||||
`
|
||||
Type: <b>Bug</b>
|
||||
Issue Type: <b>Bug</b>
|
||||
|
||||
undefined
|
||||
|
||||
VS Code version: undefined
|
||||
OS version: undefined
|
||||
Modes:
|
||||
Restricted Mode: No
|
||||
|
||||
<details>
|
||||
<summary>System Info</summary>
|
||||
@@ -291,26 +289,6 @@ Modes:
|
||||
<!-- generated by issue reporter -->`);
|
||||
});
|
||||
|
||||
test('should supply mode if applicable', () => { // {{SQL CARBON EDIT}} Modifies test for ADS
|
||||
const issueReporterModel = new IssueReporterModel({
|
||||
isUnsupported: true,
|
||||
restrictedMode: true
|
||||
});
|
||||
assert.strictEqual(issueReporterModel.serialize(),
|
||||
`
|
||||
Type: <b>Bug</b>
|
||||
|
||||
undefined
|
||||
|
||||
Azure Data Studio version: undefined
|
||||
OS version: undefined
|
||||
Restricted Mode: Yes
|
||||
Preview Features: Disabled
|
||||
Modes: Restricted, Unsupported
|
||||
|
||||
Extensions: none
|
||||
<!-- generated by issue reporter -->`);
|
||||
});
|
||||
test('should normalize GitHub urls', () => {
|
||||
[
|
||||
'https://github.com/repo',
|
||||
|
||||
Reference in New Issue
Block a user