Skip to content

Commit

Permalink
Avoid changing context key view when changing selection
Browse files Browse the repository at this point in the history
fixes #13375

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
  • Loading branch information
rschnekenbu committed Jun 26, 2024
1 parent 37e1f2c commit 29aea5b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

- [Previous Changelogs](https://github.com/eclipse-theia/theia/tree/master/doc/changelogs/)

<!-- ## not yet released
<!-- ## not yet released
- [plugin] Avoid pollution of all toolbars by actions contributed by tree views in extensions [#13768](https://github.com/eclipse-theia/theia/pull/13768) - contributed on behalf of STMicroelectronics
<a name="breaking_changes_not_yet_released">[Breaking Changes:](#breaking_changes_not_yet_released)</a>
Expand Down
4 changes: 0 additions & 4 deletions packages/plugin-ext/src/main/browser/view/tree-views-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
CompositeTreeNode,
WidgetManager
} from '@theia/core/lib/browser';
import { ViewContextKeyService } from './view-context-key-service';
import { Disposable, DisposableCollection } from '@theia/core';
import { TreeViewWidget, TreeViewNode, PluginTreeModel, TreeViewWidgetOptions } from './tree-view-widget';
import { PluginViewWidget } from './plugin-view-widget';
Expand All @@ -36,7 +35,6 @@ export class TreeViewsMainImpl implements TreeViewsMain, Disposable {

private readonly proxy: TreeViewsExt;
private readonly viewRegistry: PluginViewRegistry;
private readonly contextKeys: ViewContextKeyService;
private readonly widgetManager: WidgetManager;
private readonly fileContentStore: DnDFileContentStore;

Expand All @@ -50,7 +48,6 @@ export class TreeViewsMainImpl implements TreeViewsMain, Disposable {
this.proxy = rpc.getProxy(MAIN_RPC_CONTEXT.TREE_VIEWS_EXT);
this.viewRegistry = container.get(PluginViewRegistry);

this.contextKeys = this.container.get(ViewContextKeyService);
this.widgetManager = this.container.get(WidgetManager);
this.fileContentStore = this.container.get(DnDFileContentStore);
}
Expand Down Expand Up @@ -197,7 +194,6 @@ export class TreeViewsMainImpl implements TreeViewsMain, Disposable {
}));

this.toDispose.push(treeViewWidget.model.onSelectionChanged(event => {
this.contextKeys.view.set(treeViewId);
this.proxy.$setSelection(treeViewId, event.map((node: TreeViewNode) => node.id));
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ import { ContextKey, ContextKeyService } from '@theia/core/lib/browser/context-k

@injectable()
export class ViewContextKeyService {
protected _view: ContextKey<string>;
get view(): ContextKey<string> {
return this._view;
}

protected _viewItem: ContextKey<string>;
get viewItem(): ContextKey<string> {
return this._viewItem;
Expand Down Expand Up @@ -56,7 +51,6 @@ export class ViewContextKeyService {

@postConstruct()
protected init(): void {
this._view = this.contextKeyService.createKey('view', '');
this._viewItem = this.contextKeyService.createKey('viewItem', '');
this._activeViewlet = this.contextKeyService.createKey('activeViewlet', '');
this._activePanel = this.contextKeyService.createKey('activePanel', '');
Expand Down

0 comments on commit 29aea5b

Please sign in to comment.