fix: diff editor display error model content #3792
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Types
Background or solution
这行代码会导致 diff 状态下,git 插件读取的数据不是最新的本地文件,因为它会命中缓存,不会去获取 provideEditorDocumentModelContent 了
原因是之前为了缓存 diff 编辑器的状态,每次不会 dispose 这个 editor ref,下次进来就命中缓存。
monaco saveState 和 restoreState 都没保存已经展开的那些数据,感觉只能先搁置 restore 这个状态了,先把 bug 修复吧
Changelog
fix diff editor cannot should latest file content