fix: language re-register if disposed #2857
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
🤖 Generated by Copilot at 030c548
neverCollapse
comment (link)dispose
method toTextmateService
class to clear_encounteredLanguages
set and prevent memory leaks (link)opensumi 内使用 onlanguage 触发语法插件激活事件
core/packages/editor/src/browser/monaco-contrib/tokenizer/textmate.service.ts
Lines 202 to 204 in e2bdbea
所以 dispose 之后清除 monaco 注册的 languages 以便下次重新触发
Changelog
🤖 Generated by Copilot at 030c548
This pull request fixes a comment typo in
types.ts
and adds adispose
method toTextmateService
intextmate.service.ts
to prevent memory leaks and improve textmate tokenizer performance.