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

fix: opened editor reveal error #2947

Merged
merged 1 commit into from
Jul 27, 2023
Merged

Conversation

erha19
Copy link
Member

@erha19 erha19 commented Jul 26, 2023

Types

  • 🐛 Bug Fixes

Background or solution

🤖 Generated by Copilot at 9614923

  • Made _openedEditorTreeHandle property optional and added guard clause to updateDecorations method to prevent errors when accessing undefined properties (link, link, link)
  • Reformatted import statement for @opensumi/ide-components to fit in one line (link)
  • Improved readability of arguments for commandService.executeCommand method (link)

Changelog

🤖 Generated by Copilot at 9614923

Improve OpenedEditorModelService class in opened-editor-model.service.ts. Format imports, handle optional property, add guard clause, and fix command arguments.

@opensumi opensumi bot added the 🐞 bug Something isn't working label Jul 26, 2023
@opensumi
Copy link
Contributor

opensumi bot commented Jul 26, 2023

ChatGPT Code Review:

代码存在以下错误和拼写错误:

  1. 第11行的@opensumi/di导入的Inject应该是Injectable
  2. 第19行的@opensumi/ide-components导入的WatchEvent应该是WatchedEvent
  3. 第23行的@opensumi/ide-components导入的IEditorTreeHandle拼写错误,应该是IRecycleTreeHandle
  4. 第30行的_openedEditorTreeHandle的类型应该是可选的,需要在变量名称后面加上?
  5. 在第35行添加一行注释,解释为什么要加上这个判断条件
  6. 第42行的this.editorTreeHandle应该改为this._openedEditorTreeHandle
  7. 第50行的disableNavigateOnOpendEditor拼写错误,应该是disableNavigateOnOpenedEditor

代码的功能是一个打开的编辑器模型服务。它导入了DecorationsManagerDecorationIRecycleTreeHandleTreeNodeTypeWatchEvent等模块,并定义了OpenedEditorModelService类。该类提供了打开、关闭文件的方法,并在打开文件时执行相应的命令。

@geekeren
Copy link
Contributor

/next

@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Patch coverage: 50.00% and project coverage change: -0.01% ⚠️

Comparison is base (3e063a2) 57.63% compared to head (9614923) 57.62%.

Additional details and impacted files
@@            Coverage Diff             @@
##            v2.26    #2947      +/-   ##
==========================================
- Coverage   57.63%   57.62%   -0.01%     
==========================================
  Files        1337     1337              
  Lines       84145    84147       +2     
  Branches    17487    17488       +1     
==========================================
- Hits        48498    48491       -7     
- Misses      32398    32405       +7     
- Partials     3249     3251       +2     
Flag Coverage Δ
jsdom 52.63% <50.00%> (-0.01%) ⬇️
node 16.80% <0.00%> (-0.01%) ⬇️

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

Files Changed Coverage Δ
...rc/browser/services/opened-editor-model.service.ts 78.54% <50.00%> (-0.65%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@opensumi
Copy link
Contributor

opensumi bot commented Jul 26, 2023

🎉 PR Next version 2.26.3-next-1690364683.0 publish successful! You can install this version via npm install package@2.26.3-next-1690364683.0

2.26.3-next-1690364683.0

@erha19 erha19 merged commit 86dd70a into v2.26 Jul 27, 2023
16 checks passed
@erha19 erha19 deleted the fix/enhance-opened-editor-location branch July 27, 2023 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants