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

feat: support editor action arguments #4254

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hacke2
Copy link
Member

@hacke2 hacke2 commented Dec 20, 2024

Types

  • 🎉 New Features

Background or solution

image

Changelog

Summary by CodeRabbit

  • 新功能
    • 增加了对 Unicode 高亮的配置选项,包括允许字符和允许区域的设置。
    • 更新了配置服务,增强了对配置值的直接操作能力。
  • 本地化
    • 添加了新的本地化条目,以支持 Unicode 高亮配置的中文和英文描述。
  • 改进
    • 优化了偏好设置服务,增强了对用户偏好的响应能力。

@opensumi opensumi bot added the 🎨 feature feature required label Dec 20, 2024
Copy link
Contributor

coderabbitai bot commented Dec 20, 2024

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

warning [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning eslint > @humanwhocodes/[email protected]: Use @eslint/config-array instead
warning eslint > @humanwhocodes/config-array > @humanwhocodes/[email protected]: Use @eslint/object-schema instead
warning eslint > file-entry-cache > flat-cache > [email protected]: Rimraf versions prior to v4 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > [email protected]: Glob versions prior to v9 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning eslint-import-resolver-typescript > [email protected]: Glob versions prior to v9 are no longer supported
error Couldn't find any versions for "@opensumi/ide-dev-tool" that matches "workspace:*"

概述

演练

这个拉取请求包含了多个文件的修改,主要涉及编辑器命令服务、配置架构、本地化和首选项设置。主要变更包括扩展命令执行的灵活性、添加 Unicode 高亮的新配置选项、更新配置服务的方法,以及在不同语言中添加相应的本地化条目。这些修改旨在增强编辑器的配置和命令处理能力。

变更

文件路径 变更摘要
packages/editor/src/browser/monaco-contrib/command/command.service.ts 更新命令执行方法,支持可变参数,增强动作处理的灵活性
packages/editor/src/browser/preference/schema.ts 为 Unicode 高亮添加 allowedCharactersallowedLocales 配置属性
packages/i18n/src/common/editor/en-US.ts 添加 Unicode 高亮配置的英文本地化条目
packages/i18n/src/common/editor/zh-CN.ts 添加 Unicode 高亮配置的中文本地化条目
packages/monaco/src/browser/monaco.context-key.service.ts 增强配置服务,添加 updateValueinspect 方法,更新 getValue 方法
packages/preferences/src/browser/preference-settings.service.ts 在默认设置节中添加 Unicode 高亮相关偏好设置

可能相关的 PR

建议的标签

🎨 feature, ⚙️ refactor

建议的审阅者

  • bytemain
  • erha19
  • Ricbet

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

Copy link
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

🧹 Nitpick comments (1)
packages/editor/src/browser/preference/schema.ts (1)

1449-1458: Unicode 高亮配置的 Schema 定义完善!

新增的 Schema 定义:

  1. 类型定义正确,使用 object 类型
  2. 默认值设置合理,使用空对象
  3. 包含了可本地化的描述文本

建议:考虑为这两个配置项添加具体的属性验证规则,以确保用户输入的值符合预期格式。

建议添加以下验证规则:

  'editor.unicodeHighlight.allowedCharacters': {
    type: 'object',
    default: {},
+   additionalProperties: {
+     type: 'boolean'
+   },
    description: '%editor.configuration.unicodeHighlight.allowedCharacters%',
  },
  'editor.unicodeHighlight.allowedLocales': {
    type: 'object',
    default: {},
+   additionalProperties: {
+     type: 'boolean'
+   },
    description: '%editor.configuration.unicodeHighlight.allowedLocales%',
  },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5d6c52d and 7575afc.

📒 Files selected for processing (6)
  • packages/editor/src/browser/monaco-contrib/command/command.service.ts (2 hunks)
  • packages/editor/src/browser/preference/schema.ts (1 hunks)
  • packages/i18n/src/common/editor/en-US.ts (1 hunks)
  • packages/i18n/src/common/editor/zh-CN.ts (1 hunks)
  • packages/monaco/src/browser/monaco.context-key.service.ts (1 hunks)
  • packages/preferences/src/browser/preference-settings.service.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/i18n/src/common/editor/zh-CN.ts
🔇 Additional comments (5)
packages/i18n/src/common/editor/en-US.ts (1)

3-6: 本地化条目添加正确!

新增的 Unicode 高亮配置的本地化条目描述清晰准确。

packages/editor/src/browser/monaco-contrib/command/command.service.ts (2)

411-414: 命令执行参数支持实现正确!

execute 方法现在正确地将参数传递给 runAction 方法。


425-429: 动作运行方法更新合理!

runAction 方法已更新以支持可变参数,并正确传递给 action.run()。

packages/monaco/src/browser/monaco.context-key.service.ts (1)

64-65: 配置服务扩展实现完善!

正确绑定了 updateValue 和 inspect 方法到 monacoConfigService,增强了配置服务的功能。

packages/preferences/src/browser/preference-settings.service.ts (1)

734-735: 新增的 Unicode 高亮配置选项符合预期!

新增的两个配置项 editor.unicodeHighlight.allowedCharacterseditor.unicodeHighlight.allowedLocales 扩展了编辑器的 Unicode 高亮功能,使其更加灵活可配置。

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

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

Project coverage is 53.72%. Comparing base (5d6c52d) to head (7575afc).

Files with missing lines Patch % Lines
.../browser/monaco-contrib/command/command.service.ts 0.00% 4 Missing ⚠️
...s/monaco/src/browser/monaco.context-key.service.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4254      +/-   ##
==========================================
- Coverage   53.73%   53.72%   -0.01%     
==========================================
  Files        1622     1622              
  Lines       98562    98564       +2     
  Branches    20150    20150              
==========================================
- Hits        52958    52951       -7     
- Misses      37900    37908       +8     
- Partials     7704     7705       +1     
Flag Coverage Δ
jsdom 49.19% <0.00%> (-0.01%) ⬇️
node 15.46% <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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎨 feature feature required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant