diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts index 964de555b25..ad96ee4aef7 100644 --- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts @@ -209,13 +209,13 @@ class SharedProcessMain extends Disposable { services.set(IExtensionRecommendationNotificationService, new ExtensionRecommendationNotificationServiceChannelClient(this.server.getChannel('extensionRecommendationNotification', activeWindowRouter))); // Telemetry - const { appRoot, extensionsPath, extensionDevelopmentLocationURI, isBuilt, installSourcePath } = environmentService; - let telemetryService: ITelemetryService; let telemetryAppender: ITelemetryAppender; - if (!extensionDevelopmentLocationURI && !environmentService.disableTelemetry && productService.enableTelemetry) { + if (!environmentService.isExtensionDevelopment && !environmentService.disableTelemetry && productService.enableTelemetry) { telemetryAppender = new TelemetryLogAppender(loggerService, environmentService); + const { appRoot, extensionsPath, isBuilt, installSourcePath } = environmentService; + // Application Insights if (productService.aiConfig && productService.aiConfig.asimovKey && isBuilt) { const appInsightsAppender = new AppInsightsAppender('monacoworkbench', null, productService.aiConfig.asimovKey); diff --git a/src/vs/code/node/cliProcessMain.ts b/src/vs/code/node/cliProcessMain.ts index d50ab90f149..f330f43c192 100644 --- a/src/vs/code/node/cliProcessMain.ts +++ b/src/vs/code/node/cliProcessMain.ts @@ -135,8 +135,6 @@ class CliMain extends Disposable { const stateService = new StateService(environmentService, logService); services.set(IStateService, stateService); - const { appRoot, extensionsPath, extensionDevelopmentLocationURI, isBuilt, installSourcePath } = environmentService; - // Request services.set(IRequestService, new SyncDescriptor(RequestService)); @@ -150,11 +148,13 @@ class CliMain extends Disposable { // Telemetry const appenders: AppInsightsAppender[] = []; - if (isBuilt && !extensionDevelopmentLocationURI && !environmentService.disableTelemetry && productService.enableTelemetry) { + if (environmentService.isBuilt && !environmentService.isExtensionDevelopment && !environmentService.disableTelemetry && productService.enableTelemetry) { if (productService.aiConfig && productService.aiConfig.asimovKey) { appenders.push(new AppInsightsAppender('monacoworkbench', null, productService.aiConfig.asimovKey)); } + const { appRoot, extensionsPath, installSourcePath } = environmentService; + const config: ITelemetryServiceConfig = { appender: combinedAppender(...appenders), sendErrorTelemetry: false, diff --git a/src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.ts b/src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.ts index 60fa348e8ae..5477d2147cf 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.ts @@ -105,7 +105,7 @@ export class ExtensionRecommendationsService extends Disposable implements IExte } private isEnabled(): boolean { - return this.galleryService.isEnabled() && !this.environmentService.extensionDevelopmentLocationURI; + return this.galleryService.isEnabled() && !this.environmentService.isExtensionDevelopment; } private async activateProactiveRecommendations(): Promise { diff --git a/src/vs/workbench/services/extensions/common/abstractExtensionService.ts b/src/vs/workbench/services/extensions/common/abstractExtensionService.ts index fd1b5fd113b..a597c4f1a52 100644 --- a/src/vs/workbench/services/extensions/common/abstractExtensionService.ts +++ b/src/vs/workbench/services/extensions/common/abstractExtensionService.ts @@ -437,7 +437,7 @@ export abstract class AbstractExtensionService extends Disposable implements IEx } private async _handleExtensionTests(): Promise { - if (!this._environmentService.extensionDevelopmentLocationURI || !this._environmentService.extensionTestsLocationURI) { + if (!this._environmentService.isExtensionDevelopment || !this._environmentService.extensionTestsLocationURI) { return; } @@ -691,23 +691,8 @@ export abstract class AbstractExtensionService extends Disposable implements IEx return extensions.filter(extension => this._isEnabled(extension)); } - private _isExtensionUnderDevelopment(extension: IExtensionDescription): boolean { - if (this._environmentService.isExtensionDevelopment) { - const extDevLocs = this._environmentService.extensionDevelopmentLocationURI; - if (extDevLocs) { - const extLocation = extension.extensionLocation; - for (let p of extDevLocs) { - if (isEqualOrParent(extLocation, p)) { - return true; - } - } - } - } - return false; - } - protected _isEnabled(extension: IExtensionDescription): boolean { - if (this._isExtensionUnderDevelopment(extension)) { + if (extension.isUnderDevelopment) { // Never disable extensions under development return true; } @@ -939,7 +924,7 @@ class ProposedApiController { this.enableProposedApiForAll = !_environmentService.isBuilt || // always allow proposed API when running out of sources - (!!_environmentService.extensionDevelopmentLocationURI && productService.quality !== 'stable') || // do not allow proposed API against stable builds when developing an extension + (_environmentService.isExtensionDevelopment && productService.quality !== 'stable') || // do not allow proposed API against stable builds when developing an extension (this.enableProposedApiFor.length === 0 && Array.isArray(_environmentService.extensionEnabledProposedApi)); // always allow proposed API if --enable-proposed-api is provided without extension ID this.productAllowProposedApi = new Set(); diff --git a/src/vs/workbench/services/themes/browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/browser/workbenchThemeService.ts index 5611ff53613..90e4c55366c 100644 --- a/src/vs/workbench/services/themes/browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/browser/workbenchThemeService.ts @@ -692,19 +692,17 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { class ThemeFileWatcher { - private inExtensionDevelopment: boolean; private watchedLocation: URI | undefined; private watcherDisposable: IDisposable | undefined; private fileChangeListener: IDisposable | undefined; - constructor(private fileService: IFileService, environmentService: IWorkbenchEnvironmentService, private onUpdate: () => void) { - this.inExtensionDevelopment = !!environmentService.extensionDevelopmentLocationURI; + constructor(private fileService: IFileService, private environmentService: IWorkbenchEnvironmentService, private onUpdate: () => void) { } update(theme: { location?: URI, watch?: boolean; }) { if (!resources.isEqual(theme.location, this.watchedLocation)) { this.dispose(); - if (theme.location && (theme.watch || this.inExtensionDevelopment)) { + if (theme.location && (theme.watch || this.environmentService.isExtensionDevelopment)) { this.watchedLocation = theme.location; this.watcherDisposable = this.fileService.watch(theme.location); this.fileService.onDidFilesChange(e => {