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 for mutual open between launch.json and launch editor #2738

Merged

Conversation

Ricbet
Copy link
Member

@Ricbet Ricbet commented May 22, 2023

Types

  • 🎉 New Features

Background or solution

🤖 Generated by Copilot at fa5f3e2

  • Add a label property to the COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION command, which is used to display the command name in the UI (link)
  • Add a new enum LAUNCH_OPEN to indicate the type of view to open when executing the COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION command (link)
  • Modify the registerCommands method of the DebugContribution class to accept a parameter of type LAUNCH_OPEN for the COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION command, and call the appropriate method of the debugConfigurationService to open the launch editor view or the JSON file of the debug configurations (link)
  • Add a new method openLaunchEditor to the DebugConfigurationManager class, which opens the launch editor view for editing the debug configurations using a custom URI scheme (link)
  • Modify the addConfiguration method of the DebugConfigurationManager class to open the JSON file of the debug configurations instead of the launch editor view when adding a new configuration (link)
  • Add a new property openLaunchEditor to the DebugConfigurationService class, which exposes the openLaunchEditor method of the debugConfigurationManager to the DebugContribution class (link)
  • Add a new button to the FloatingClickWidget component, which calls the openLaunchEditor method of the DebugConfigurationService to open the launch editor view (link)
  • Add a dependency injection of the openLaunchEditor method to the FloatingClickWidget component (link)
  • Add a new menu item to the MenuId.EditorTitle location, which allows the user to switch between the launch editor view and the JSON file of the debug configurations using the COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION command (link)
  • Add the MenuContribution interface to the @Domain decorator of the LaunchPreferencesContribution class, indicating that the class also provides menu contributions to the workbench (link)
  • Add a CSS rule to create some spacing between the buttons in the floating widget (link)
  • Import the LAUNCH_VIEW_SCHEME and LAUNCH_VIEW_COMPONENT_ID constants from the packages/debug/src/common/constants.ts file, where they are defined, instead of duplicating them in the packages/debug/src/browser/preferences/launch-preferences-contribution.ts file (link)
  • Import the LAUNCH_VIEW_SCHEME constant from the packages/debug/src/common/constants.ts file, where it is defined, instead of duplicating it in the packages/debug/src/browser/debug-configuration-manager.ts file (link)
  • Import the COMMON_COMMANDS, IMenuRegistry, MenuContribution, and MenuId objects from the @opensumi/ide-core-browser package, which are used to access the COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION command and register menu items to the workbench (link)
  • Add new localization keys and values for the label of the button and the menu item that open the launch editor view in English and Chinese languages (link, link)

launch.json to launch editor
image

launch editor to launch.json
image

Changelog

🤖 Generated by Copilot at fa5f3e2

This pull request adds a new feature to the debug package that allows users to edit the debug configurations in a launch editor view instead of a JSON file. It also adds a button to the floating widget and a menu item to the editor title bar that enable users to switch between the two views. It updates the command, service, manager, and preference classes to support the new feature, and adds some constants, styles, and localization keys and values.

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

opensumi bot commented May 22, 2023

ChatGPT Code Review:

代码的功能为实现在 launch.json 和 launch editor 之间相互打开的互操作性。具体地,代码增加了一个名为 OPEN_LAUNCH_CONFIGURATION 的命令,使用户可以通过编辑器中的按钮将编辑器中的配置打开为 .json 文件,或者在 .json 文件中打开编辑器中配置的相应项目。此外,该代码还增加了一些用户界面元素,如添加配置按钮和浮动点击小部件。

@Ricbet Ricbet merged commit a5c1cf2 into feat/implement-launch-ui May 22, 2023
@Ricbet Ricbet deleted the feat/support-editor-title-open-launch branch May 22, 2023 09:48
Ricbet added a commit that referenced this pull request Jun 6, 2023
* feat: implement the base launch UI

* chore: improve code

* feat: implement launch json editor (#2598)

* feat: implement launch json schema editor

* feat: implement launch json editor

* chore: improve code

* chore: improve select widget and beauty styles (#2635)

* chore: support anyof field

* feat: support additional and anyof/oneof field (#2692)

* feat: support additional and anyof/oneof field

* chore: improve code

* fix: use i18n

* feat: support add new properties (#2712)

* feat: launch UI support delete properties (#2736)

* feat: launch UI support delete properties

* fix: bug

* feat: support for mutual open between launch.json and launch editor (#2738)

* fix: module error

* feat: support json and launch editor data linkage (#2746)

* feat: support json and launch editor data linkage

* feat: implement add configuration

* fix: typo

* feat: support snippet items data linkage (#2755)

* fix: enter keyboard remove array field

* fix: additional template code

* feat: implement configuration items data linkage

* fix: array field undefined

* fix: add lock

* fix: ci

* fix: ci

* chore: improve styles
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.

2 participants