Skip to content

Commit

Permalink
changelog opens release notes in browser in offline mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Jul 23, 2018
1 parent ad1c8c1 commit f490af7
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class Extension implements IExtension {
private stateProvider: IExtensionStateProvider<ExtensionState>,
public locals: ILocalExtension[],
public gallery: IGalleryExtension,
private telemetryService: ITelemetryService
private telemetryService: ITelemetryService,
private configurationService: IConfigurationService
) { }

get type(): LocalExtensionType {
Expand Down Expand Up @@ -277,7 +278,8 @@ ${this.description}

if (!changelogUrl) {
if (this.type === LocalExtensionType.System) {
return TPromise.as('Please check the [VS Code Release Notes](command:update.showCurrentReleaseNotes) for changes to the built-in extensions.');
const href = this.configurationService.getValue(offlineModeSetting) === true ? 'https://code.visualstudio.com/updates' : 'command:update.showCurrentReleaseNotes';
return TPromise.as(`Please check the [VS Code Release Notes](${href}) for changes to the built-in extensions.`);
}

return TPromise.wrapError<string>(new Error('not available'));
Expand Down Expand Up @@ -439,7 +441,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
const locals = groupById[getGalleryExtensionIdFromLocal(local)];
locals.splice(locals.indexOf(local), 1);
locals.splice(0, 0, local);
const extension = installedById[local.identifier.id] || new Extension(this.galleryService, this.stateProvider, locals, null, this.telemetryService);
const extension = installedById[local.identifier.id] || new Extension(this.galleryService, this.stateProvider, locals, null, this.telemetryService, this.configurationService);
extension.locals = locals;
extension.enablementState = this.extensionEnablementService.getEnablementState(local);
const recommendation = allRecommendations.filter(r => areSameExtensions({ id: r.extensionId }, { id: extension.id }))[0];
Expand Down Expand Up @@ -562,7 +564,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
this.syncLocalWithGalleryExtension(result, gallery);
}
} else {
result = new Extension(this.galleryService, this.stateProvider, [], gallery, this.telemetryService);
result = new Extension(this.galleryService, this.stateProvider, [], gallery, this.telemetryService, this.configurationService);
}

if (maliciousExtensionSet.has(result.id)) {
Expand Down Expand Up @@ -895,7 +897,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
let extension = this.installed.filter(e => areSameExtensions(e, gallery.identifier))[0];

if (!extension) {
extension = new Extension(this.galleryService, this.stateProvider, [], gallery, this.telemetryService);
extension = new Extension(this.galleryService, this.stateProvider, [], gallery, this.telemetryService, this.configurationService);
}

extension.gallery = gallery;
Expand All @@ -908,7 +910,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
private onDidInstallExtension(event: DidInstallExtensionEvent): void {
const { local, zipPath, error, gallery } = event;
const installingExtension = gallery ? this.installing.filter(e => areSameExtensions(e, gallery.identifier))[0] : null;
const extension: Extension = installingExtension ? installingExtension : zipPath ? new Extension(this.galleryService, this.stateProvider, [local], null, this.telemetryService) : null;
const extension: Extension = installingExtension ? installingExtension : zipPath ? new Extension(this.galleryService, this.stateProvider, [local], null, this.telemetryService, this.configurationService) : null;
if (extension) {
this.installing = installingExtension ? this.installing.filter(e => e !== installingExtension) : this.installing;
if (!error) {
Expand Down

0 comments on commit f490af7

Please sign in to comment.