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: language re-register if disposed #2857

Merged
merged 3 commits into from
Jun 30, 2023
Merged

Conversation

AhkunTa
Copy link
Member

@AhkunTa AhkunTa commented Jun 29, 2023

Types

  • 🐛 Bug Fixes

Background or solution

🤖 Generated by Copilot at 030c548

  • Fix typo in neverCollapse comment (link)
  • Add dispose method to TextmateService class to clear _encounteredLanguages set and prevent memory leaks (link)

opensumi 内使用 onlanguage 触发语法插件激活事件

monaco.languages.onLanguage(language.id, async () => {
await this.loadLanguageConfiguration(language, baseUri);
this.activateLanguage(language.id);

所以 dispose 之后清除 monaco 注册的 languages 以便下次重新触发

Changelog

🤖 Generated by Copilot at 030c548

This pull request fixes a comment typo in types.ts and adds a dispose method to TextmateService in textmate.service.ts to prevent memory leaks and improve textmate tokenizer performance.

@opensumi opensumi bot added the 🐞 bug Something isn't working label Jun 29, 2023
@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (37a29e4) 57.68% compared to head (030c548) 57.68%.

Additional details and impacted files
@@           Coverage Diff           @@
##            v2.25    #2857   +/-   ##
=======================================
  Coverage   57.68%   57.68%           
=======================================
  Files        1336     1336           
  Lines       83906    83909    +3     
  Branches    17445    17445           
=======================================
+ Hits        48404    48407    +3     
  Misses      32270    32270           
  Partials     3232     3232           
Flag Coverage Δ
jsdom 52.71% <100.00%> (+<0.01%) ⬆️
node 16.78% <0.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
packages/core-browser/src/toolbar/types.ts 100.00% <ø> (ø)
...owser/monaco-contrib/tokenizer/textmate.service.ts 19.33% <100.00%> (+0.50%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Ricbet Ricbet merged commit df885a3 into v2.25 Jun 30, 2023
@Ricbet Ricbet deleted the fix/language-register-if-disposed branch June 30, 2023 05:46
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.

2 participants