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: location opened editor when open file #2853

Merged
merged 1 commit into from
Jun 29, 2023
Merged

Conversation

pipiiiiii
Copy link
Contributor

@pipiiiiii pipiiiiii commented Jun 29, 2023

Types

  • 🐛 Bug Fixes

Background or solution

🤖 Generated by Copilot at bf53536

  • Add a new command LOCATION to locate a URI in the opened editors view (link)
  • Import the OPEN_EDITORS_COMMANDS object and use the LOCATION command in the EditorGroup class (link)
  • Replace the conditional logic for locating a URI in the file tree with a call to the locationInTree method in the open and openToSide methods of the EditorGroup class (link, link)
  • Add the locationInTree method to the EditorGroup class to handle locating a URI in both the file tree and the opened editors view, depending on the options (link)
  • Add the locateInOpenedEditor method to the EditorGroup class to execute the LOCATION command with a URI (link)
  • Add a new property disableNavigateOnOpendEditor to the IResourceOpenOptions interface to control whether to skip locating the URI in the opened editors view (link)
  • Register the LOCATION command handler in the opened-editor.contribution.ts file and call the location method of the OpenedEditorModelService with a URI (link, link)
  • Modify the openResource method of the OpenedEditorModelService class to pass the disableNavigateOnOpendEditor option to the executeCommand call (link)

效果是点击 editor tab 后,opened editors 中文件同步选中状态 #2849
同时依赖 #2842 合并

Changelog

🤖 Generated by Copilot at bf53536

This pull request adds a new feature and a new command to locate a URI in the opened editors view. It also refactors some existing code to use a common method for locating a URI in different views. It introduces a new option to disable locating a URI in the opened editors view when opening a resource from the view itself. The affected files are workbench-editor.service.ts, opened-editor.contribution.ts, common.command.ts, editor.ts, and opened-editor-model.service.ts.

@pipiiiiii pipiiiiii requested a review from Ricbet June 29, 2023 02:16
@opensumi opensumi bot added 🎨 feature feature required ⚙️ refactor Refactor code labels Jun 29, 2023
@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Patch coverage: 92.30% and project coverage change: +0.02 🎉

Comparison is base (dc8c4e5) 57.65% compared to head (bf53536) 57.67%.

Additional details and impacted files
@@            Coverage Diff             @@
##            v2.25    #2853      +/-   ##
==========================================
+ Coverage   57.65%   57.67%   +0.02%     
==========================================
  Files        1336     1336              
  Lines       84152    83906     -246     
  Branches    17464    17445      -19     
==========================================
- Hits        48518    48395     -123     
+ Misses      32396    32278     -118     
+ Partials     3238     3233       -5     
Flag Coverage Δ
jsdom 52.70% <92.30%> (+<0.01%) ⬆️
node 16.78% <7.69%> (+0.04%) ⬆️

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

Impacted Files Coverage Δ
packages/editor/src/common/editor.ts 100.00% <ø> (ø)
...ges/editor/src/browser/workbench-editor.service.ts 59.50% <90.90%> (+0.34%) ⬆️
packages/core-browser/src/common/common.command.ts 100.00% <100.00%> (ø)
...rc/browser/services/opened-editor-model.service.ts 78.36% <100.00%> (ø)

... and 5 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.

@pipiiiiii pipiiiiii changed the title WIP: feat: location opened editor when open file feat: location opened editor when open file Jun 29, 2023
@pipiiiiii pipiiiiii merged commit 37a29e4 into v2.25 Jun 29, 2023
@pipiiiiii pipiiiiii deleted the fix/open-location branch June 29, 2023 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎨 feature feature required ⚙️ refactor Refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants