|
6 | 6 | import 'vs/css!./media/explorerviewlet';
|
7 | 7 | import { localize } from 'vs/nls';
|
8 | 8 | import { mark } from 'vs/base/common/performance';
|
9 |
| -import { VIEWLET_ID, OpenEditorsVisibleContext, VIEW_ID, IFilesConfiguration, ExplorerViewletVisibleContext } from 'vs/workbench/contrib/files/common/files'; |
| 9 | +import { VIEWLET_ID, VIEW_ID, IFilesConfiguration, ExplorerViewletVisibleContext } from 'vs/workbench/contrib/files/common/files'; |
10 | 10 | import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet';
|
11 |
| -import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; |
| 11 | +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; |
12 | 12 | import { ExplorerView } from 'vs/workbench/contrib/files/browser/views/explorerView';
|
13 | 13 | import { EmptyView } from 'vs/workbench/contrib/files/browser/views/emptyView';
|
14 | 14 | import { OpenEditorsView } from 'vs/workbench/contrib/files/browser/views/openEditorsView';
|
@@ -43,25 +43,17 @@ const openEditorsViewIcon = registerIcon('open-editors-view-icon', Codicon.book,
|
43 | 43 |
|
44 | 44 | export class ExplorerViewletViewsContribution extends Disposable implements IWorkbenchContribution {
|
45 | 45 |
|
46 |
| - private openEditorsVisibleContextKey!: IContextKey<boolean>; |
47 |
| - |
48 | 46 | constructor(
|
49 | 47 | @IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
|
50 |
| - @IConfigurationService private readonly configurationService: IConfigurationService, |
51 |
| - @IContextKeyService contextKeyService: IContextKeyService, |
52 | 48 | @IProgressService progressService: IProgressService
|
53 | 49 | ) {
|
54 | 50 | super();
|
55 | 51 |
|
56 | 52 | progressService.withProgress({ location: ProgressLocation.Explorer }, () => workspaceContextService.getCompleteWorkspace()).finally(() => {
|
57 | 53 | this.registerViews();
|
58 | 54 |
|
59 |
| - this.openEditorsVisibleContextKey = OpenEditorsVisibleContext.bindTo(contextKeyService); |
60 |
| - this.updateOpenEditorsVisibility(); |
61 |
| - |
62 | 55 | this._register(workspaceContextService.onDidChangeWorkbenchState(() => this.registerViews()));
|
63 | 56 | this._register(workspaceContextService.onDidChangeWorkspaceFolders(() => this.registerViews()));
|
64 |
| - this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(e))); |
65 | 57 | });
|
66 | 58 | }
|
67 | 59 |
|
@@ -116,7 +108,6 @@ export class ExplorerViewletViewsContribution extends Disposable implements IWor
|
116 | 108 | ctorDescriptor: new SyncDescriptor(OpenEditorsView),
|
117 | 109 | containerIcon: openEditorsViewIcon,
|
118 | 110 | order: 0,
|
119 |
| - when: OpenEditorsVisibleContext, |
120 | 111 | canToggleVisibility: true,
|
121 | 112 | canMoveView: true,
|
122 | 113 | collapsed: false,
|
@@ -156,16 +147,6 @@ export class ExplorerViewletViewsContribution extends Disposable implements IWor
|
156 | 147 | }
|
157 | 148 | };
|
158 | 149 | }
|
159 |
| - |
160 |
| - private onConfigurationUpdated(e: IConfigurationChangeEvent): void { |
161 |
| - if (e.affectsConfiguration('explorer.openEditors.visible')) { |
162 |
| - this.updateOpenEditorsVisibility(); |
163 |
| - } |
164 |
| - } |
165 |
| - |
166 |
| - private updateOpenEditorsVisibility(): void { |
167 |
| - this.openEditorsVisibleContextKey.set(this.workspaceContextService.getWorkbenchState() === WorkbenchState.EMPTY || this.configurationService.getValue('explorer.openEditors.visible') !== 0); |
168 |
| - } |
169 | 150 | }
|
170 | 151 |
|
171 | 152 | export class ExplorerViewPaneContainer extends ViewPaneContainer {
|
|
0 commit comments