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: diff editor display error model content #3792

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

bytemain
Copy link
Member

Types

  • 🐛 Bug Fixes

Background or solution

image

这行代码会导致 diff 状态下,git 插件读取的数据不是最新的本地文件,因为它会命中缓存,不会去获取 provideEditorDocumentModelContent 了

原因是之前为了缓存 diff 编辑器的状态,每次不会 dispose 这个 editor ref,下次进来就命中缓存。
image
image

monaco saveState 和 restoreState 都没保存已经展开的那些数据,感觉只能先搁置 restore 这个状态了,先把 bug 修复吧

Changelog

fix diff editor cannot should latest file content

@opensumi opensumi bot added the 🐞 bug Something isn't working label Jun 20, 2024
Copy link

codecov bot commented Jun 20, 2024

Codecov Report

Attention: Patch coverage is 53.84615% with 6 lines in your changes missing coverage. Please review.

Project coverage is 55.33%. Comparing base (c57c7ea) to head (8e224e6).

Files Patch % Lines
...ges/editor/src/browser/workbench-editor.service.ts 63.63% 3 Missing and 1 partial ⚠️
...es/editor/src/browser/editor-collection.service.ts 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             v3.1    #3792   +/-   ##
=======================================
  Coverage   55.32%   55.33%           
=======================================
  Files        1540     1540           
  Lines       93895    93894    -1     
  Branches    19283    19284    +1     
=======================================
+ Hits        51952    51957    +5     
+ Misses      34800    34793    -7     
- Partials     7143     7144    +1     
Flag Coverage Δ
jsdom 50.80% <53.84%> (+<0.01%) ⬆️
node 15.55% <0.00%> (+<0.01%) ⬆️

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

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

@bytemain bytemain merged commit f7ea0ac into v3.1 Jun 20, 2024
12 checks passed
@bytemain bytemain deleted the fix/diff-editor-hit-error-cache branch June 20, 2024 11:54
erha19 pushed a commit that referenced this pull request Jun 24, 2024
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

2 participants