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

feat: support delete or edit breakpoints when hovering on the it #2655

Merged

Conversation

Ricbet
Copy link
Member

@Ricbet Ricbet commented Apr 28, 2023

Types

  • 🎉 New Features

Background or solution

🤖 Generated by Copilot at a0d60ad

  • Simplify the logic of the removeAllBreakpoints command and remove the isEnabled property (link)
  • Add internationalization, external icons, and editor-related functions to the debug-breakpoints.view.tsx file (link)
  • Use the BreakpointManager service for managing and editing breakpoints in the debug-breakpoints.view.tsx file (link, link)
  • Add the title prop and use it as the title attribute for the breakpoint file item label in the BreakpointFileItem component (link, link, link)
  • Add the removeBreakpoint function and the close icon to the BreakpointFileItem component and handle the click event to remove all breakpoints associated with the file (link, link)
  • Add the editBreakpoint function and the edit icon to the BreakpointItem component and handle the click event to open the editor and execute the DEBUG_COMMANDS.EDIT_BREAKPOINT command (link, link)
  • Add a new class .debug_breakpoints_item_control to control the display of the edit and remove icons for each breakpoint item in the debug-breakpoints.module.less file (link, link, link)
  • Align the breakpoint file item content to the left and right edges of the container and add some margin to the badge and the close icon in the debug-breakpoints.module.less file (link, link)
  • Remove an empty line from the debug-contribution.ts file for code readability and style consistency (link)

Kapture 2023-04-28 at 11 25 53

  • 文件节点支持 hover 删除该文件下的所有断点
  • 断点列表面板新增 editor breakpoint 按钮,hover 出现,点击后可以直接编辑该断点表达式

Changelog

🤖 Generated by Copilot at a0d60ad

This pull request improves the debug feature of the opensumi core by enhancing the code quality, style, and functionality of the DebugContribution class and the breakpoint view components. It also adds internationalization, external icons, and editor integration for breakpoints.

@Ricbet Ricbet self-assigned this Apr 28, 2023
@opensumi opensumi bot added the 🎨 feature feature required label Apr 28, 2023
@opensumi
Copy link
Contributor

opensumi bot commented Apr 28, 2023

ChatGPT Code Review:

CodeReview:

  1. 删除无用的import

  2. 断点列表面板的具体功能描述需要更清晰(如何触发、效果是什么),目前只能看图片理解。

  3. 代码中未使用的变量可以删除,如LAUNCH_JSON_REGEX、status、manager。

  4. BreakpointFileItem组件的icon prop没有使用。

  5. BreakpointFileItem组件的title prop没有校验。

  6. 建议rename BreakpointFileItem的label prop,因为其实是path。

  7. 可以将BreakpointManager作为依赖注入,并在BreakpointItem中使用。

  8. 删除debug_breakpoints_module.less中不再使用的样式。同时,建议使用类名来获取样式(如cls(getIcon('file-text'), styles.file_item_icon))。

@codecov
Copy link

codecov bot commented Apr 28, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (5bc1426) 57.64% compared to head (1968de2) 57.64%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2655   +/-   ##
=======================================
  Coverage   57.64%   57.64%           
=======================================
  Files        1327     1327           
  Lines       83676    83676           
  Branches    17421    17421           
=======================================
  Hits        48235    48235           
  Misses      32201    32201           
  Partials     3240     3240           
Flag Coverage Δ
jsdom 52.65% <100.00%> (ø)
node 16.77% <0.00%> (ø)

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

Impacted Files Coverage Δ
...debug/src/browser/breakpoint/breakpoint-manager.ts 86.18% <100.00%> (ø)

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

@Ricbet Ricbet force-pushed the feat/support-breakpoint-file-item-del-and-edit-breakpoint branch from a0d60ad to 1968de2 Compare May 4, 2023 07:50
@Ricbet Ricbet changed the title WIP: feat: hover edit breakpoint and hover delete of file breakpoint items feat: hover edit breakpoint and hover delete of file breakpoint items May 4, 2023
@erha19
Copy link
Member

erha19 commented May 5, 2023

@Ricbet 标题可以修改一下,例如 support delete or edit breakpoints when hovering on the it

@Ricbet Ricbet changed the title feat: hover edit breakpoint and hover delete of file breakpoint items feat: support delete or edit breakpoints when hovering on the it May 5, 2023
@Ricbet Ricbet merged commit c6776e1 into main May 5, 2023
14 checks passed
@Ricbet Ricbet deleted the feat/support-breakpoint-file-item-del-and-edit-breakpoint branch May 5, 2023 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants