refactor: auto update decoration targets #2690
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Types
Background or solution
🤖 Generated by Copilot at 79b8bf5
onWillUpdate
event and its related fields, getters, calls, and listeners from various tree model classes and services, as it was no longer needed (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)DecorationsManager
class inpackages/components/src/recycle-tree/tree/decoration/DecorationManager.ts
to handle the decoration updates for the tree nodes, and used it in the constructors of various tree model classes and services (link, link, link)ExtensionCompositeTreeNode
andExtensionTreeNode
classes inpackages/extension/src/browser/vscode/api/tree-view/tree-view.node.defined.ts
to pass thetreeItemId
parameter as the name option to the super constructor, to ensure the node has a unique identifier that matches the extension tree item (link, link)精简代码结构
Changelog
🤖 Generated by Copilot at 79b8bf5
This pull request removes the redundant
onWillUpdate
events from various tree model classes and simplifies their code. It also enhances theDecorationsManager
class to handle the decoration updates automatically when the tree nodes change. Additionally, it assigns names to the extension tree nodes based on their IDs to avoid conflicts. It also updates the related tests and services to reflect these changes.