Skip to content

fix: textmate service is not compatible with monaco 0.47#3847

Merged
bytemain merged 1 commit intomainfrom
fix/monaco-0.47-textmate
Jul 12, 2024
Merged

fix: textmate service is not compatible with monaco 0.47#3847
bytemain merged 1 commit intomainfrom
fix/monaco-0.47-textmate

Conversation

@bytemain
Copy link
Copy Markdown
Member

@bytemain bytemain commented Jul 12, 2024

Types

  • 🐛 Bug Fixes

Background or solution

dispose textmate service 的时候会报错

image

0.35.x 中 ILanguageService 中的 _encounteredLanguages 在 0.47.x 中已经被移除
等价的是 _requestedBasicLanguages 和 _requestedRichLanguages

Changelog

fix textmate service is not compatible with monaco 0.47

Summary by CodeRabbit

  • Bug Fixes
    • 优化了 TextmateService 类的 dispose 方法,现在在清除 _requestedRichLanguages_requestedBasicLanguages 时添加了条件处理,并在未找到服务时记录警告日志。

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 12, 2024

Walkthrough

TextmateService 类的 dispose 方法进行了修改,添加了条件以清除 monacoLanguageService 实例中的 _requestedRichLanguages_requestedBasicLanguages,并在相应的服务未找到时记录警告日志。

Changes

文件路径 更改摘要
packages/editor/src/browser/monaco-contrib/tokenizer/textmate.service.ts TextmateService 类中的 dispose 方法进行了修改,移除了 this.monacoLanguageService['_encounteredLanguages'].clear();,添加了清除 _requestedRichLanguages_requestedBasicLanguages 的条件,并在相应的服务未找到时记录警告日志。

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@railway-app railway-app Bot temporarily deployed to core-pr-3847 July 12, 2024 07:11 Destroyed
@railway-app
Copy link
Copy Markdown

railway-app Bot commented Jul 12, 2024

🚅 Previously deployed to Railway in the core project. Environment has been deleted.

@opensumi opensumi Bot added the 🐞 bug Something isn't working label Jul 12, 2024
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5ece2fb and 6372809.

Files selected for processing (1)
  • packages/editor/src/browser/monaco-contrib/tokenizer/textmate.service.ts (1 hunks)
Additional comments not posted (2)
packages/editor/src/browser/monaco-contrib/tokenizer/textmate.service.ts (2)

916-920: 改进了处理 _requestedRichLanguages 服务的逻辑

新代码在清除 _requestedRichLanguages 服务时进行了条件检查,并在服务未找到时记录警告日志。这提高了代码的健壮性。


922-926: 改进了处理 _requestedBasicLanguages 服务的逻辑

新代码在清除 _requestedBasicLanguages 服务时进行了条件检查,并在服务未找到时记录警告日志。这提高了代码的健壮性。

Copy link
Copy Markdown
Member

@Aaaaash Aaaaash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 54.99%. Comparing base (5ece2fb) to head (6372809).

Files Patch % Lines
...owser/monaco-contrib/tokenizer/textmate.service.ts 0.00% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3847   +/-   ##
=======================================
  Coverage   54.99%   54.99%           
=======================================
  Files        1556     1556           
  Lines       94793    94800    +7     
  Branches    19402    19406    +4     
=======================================
+ Hits        52131    52138    +7     
+ Misses      35448    35447    -1     
- Partials     7214     7215    +1     
Flag Coverage Δ
jsdom 50.43% <0.00%> (+<0.01%) ⬆️
node 15.56% <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 3e0fe4e into main Jul 12, 2024
@bytemain bytemain deleted the fix/monaco-0.47-textmate branch July 12, 2024 07:39
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