Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: auto update decoration targets #2690

Merged
merged 3 commits into from
May 15, 2023

Conversation

erha19
Copy link
Member

@erha19 erha19 commented May 9, 2023

Types

  • 🪚 Refactors

Background or solution

🤖 Generated by Copilot at 79b8bf5

  • Removed the 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)
  • Added a new DecorationsManager class in packages/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)
  • Modified the constructors of the ExtensionCompositeTreeNode and ExtensionTreeNode classes in packages/extension/src/browser/vscode/api/tree-view/tree-view.node.defined.ts to pass the treeItemId 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 the DecorationsManager 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.

@erha19 erha19 requested a review from bytemain May 9, 2023 09:54
@opensumi opensumi bot added the ⚙️ refactor Refactor code label May 9, 2023
@codecov
Copy link

codecov bot commented May 15, 2023

Codecov Report

Patch coverage: 81.81% and project coverage change: +0.09 🎉

Comparison is base (c6776e1) 57.63% compared to head (d7b8752) 57.73%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2690      +/-   ##
==========================================
+ Coverage   57.63%   57.73%   +0.09%     
==========================================
  Files        1327     1327              
  Lines       83676    83563     -113     
  Branches    17421    17381      -40     
==========================================
+ Hits        48228    48245      +17     
+ Misses      32207    32098     -109     
+ Partials     3241     3220      -21     
Flag Coverage Δ
jsdom 52.73% <81.81%> (+0.08%) ⬆️
node 16.80% <0.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ages/debug/src/browser/editor/debug-hover-model.ts 76.47% <ø> (+0.28%) ⬆️
...c/browser/editor/debug-hover-tree.model.service.ts 73.37% <ø> (+1.53%) ⬆️
...ug/src/browser/view/console/debug-console-model.ts 85.71% <ø> (-2.29%) ⬇️
...r/view/console/debug-console-tree.model.service.ts 68.30% <ø> (-0.55%) ⬇️
...rc/browser/view/variables/debug-variables-model.ts 94.11% <ø> (+3.64%) ⬆️
...ew/variables/debug-variables-tree.model.service.ts 59.05% <ø> (+0.82%) ⬆️
.../debug/src/browser/view/watch/debug-watch-model.ts 100.00% <ø> (ø)
...owser/view/watch/debug-watch-tree.model.service.ts 63.36% <ø> (-0.60%) ⬇️
...er/vscode/api/tree-view/tree-view.model.service.ts 21.30% <ø> (-0.73%) ⬇️
...rc/browser/vscode/api/tree-view/tree-view.model.ts 100.00% <ø> (ø)
... and 9 more

... and 16 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@erha19 erha19 merged commit ba5213f into main May 15, 2023
12 checks passed
@erha19 erha19 deleted the refactor/auto-update-decoration-targets branch May 15, 2023 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ refactor Refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants