提交 f15deb51 编写于 作者: J Jackson Kearl 提交者: Ramya Rao

Feature request: remove auto-closing of extension details (#51399)

* Don't close extensions on navigating to different activity view.
Add a config option to restore previous behaviour.

* Naming

* Naming #2

* Update wording.
上级 0e97f85c
......@@ -92,9 +92,11 @@ export interface IExtensionsWorkbenchService {
export const ConfigurationKey = 'extensions';
export const AutoUpdateConfigurationKey = 'extensions.autoUpdate';
export const ShowRecommendationsOnlyOnDemandKey = 'extensions.showRecommendationsOnlyOnDemand';
export const CloseExtensionDetailsOnViewChangeKey = 'extensions.closeExtensionDetailsOnViewChange';
export interface IExtensionsConfiguration {
autoUpdate: boolean;
ignoreRecommendations: boolean;
showRecommendationsOnlyOnDemand: boolean;
closeExtensionDetailsOnViewChange: boolean;
}
......@@ -217,6 +217,11 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)
type: 'boolean',
description: localize('extensionsShowRecommendationsOnlyOnDemand', "If set to true, recommendations will not be fetched or shown unless specifically requested by the user."),
default: false
},
'extensions.closeExtensionDetailsOnViewChange': {
type: 'boolean',
description: localize('extensionsCloseExtensionDetailsOnViewChange', "If set to true, editors with extension details will be automatically closed upon navigating away from the Extensions View."),
default: false
}
}
});
......
......@@ -24,7 +24,7 @@ import { append, $, addStandardDisposableListener, EventType, addClass, removeCl
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { IExtensionsWorkbenchService, IExtensionsViewlet, VIEWLET_ID, ExtensionState, AutoUpdateConfigurationKey, ShowRecommendationsOnlyOnDemandKey, VIEW_CONTAINER } from '../common/extensions';
import { IExtensionsWorkbenchService, IExtensionsViewlet, VIEWLET_ID, ExtensionState, AutoUpdateConfigurationKey, ShowRecommendationsOnlyOnDemandKey, CloseExtensionDetailsOnViewChangeKey, VIEW_CONTAINER } from '../common/extensions';
import {
ShowEnabledExtensionsAction, ShowInstalledExtensionsAction, ShowRecommendedExtensionsAction, ShowPopularExtensionsAction, ShowDisabledExtensionsAction,
ShowOutdatedExtensionsAction, ClearExtensionsInputAction, ChangeSortAction, UpdateAllAction, CheckForUpdatesAction, DisableAllAction, EnableAllAction,
......@@ -414,14 +414,16 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio
return;
}
const promises = this.editorGroupService.groups.map(group => {
const editors = group.editors.filter(input => input instanceof ExtensionsInput);
const promises = editors.map(editor => group.closeEditor(editor));
if (this.configurationService.getValue<boolean>(CloseExtensionDetailsOnViewChangeKey)) {
const promises = this.editorGroupService.groups.map(group => {
const editors = group.editors.filter(input => input instanceof ExtensionsInput);
const promises = editors.map(editor => group.closeEditor(editor));
return TPromise.join(promises);
});
return TPromise.join(promises);
});
TPromise.join(promises).done(null, onUnexpectedError);
TPromise.join(promises).done(null, onUnexpectedError);
}
}
private progress<T>(promise: TPromise<T>): TPromise<T> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册