Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

hui2334387208
Copy link
Contributor

@hui2334387208 hui2334387208 commented Jan 2, 2025

Types

  • 🧹 Chores

Background or solution

Changelog

Summary by CodeRabbit

  • 新功能
    • 为 VS Code 扩展的 Webview 添加了端口映射配置选项。
    • 引入了 WebviewPortMapping 接口,支持更灵活的本地主机连接处理。
    • 新增 DocumentFilter 接口的 exclusive 属性,允许指定独占文档过滤器。
    • 引入 WorkspaceTrustRequestOptions 接口和 requestWorkspaceTrust 函数,用于管理工作区信任请求。

@hui2334387208 hui2334387208 changed the title feat: update WebviewPortMapping type Chores: update WebviewPortMapping type Jan 2, 2025
@opensumi opensumi bot added the 🎨 feature feature required label Jan 2, 2025
Copy link
Contributor

coderabbitai bot commented Jan 2, 2025

Warning

Rate limit exceeded

@hui2334387208 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 8 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between f8af3c8 and 0b87479.

📒 Files selected for processing (1)
  • packages/types/vscode.d.ts (1 hunks)

概述

遍历

此更改在 VSCode 的类型定义中引入了一个新的 WebviewPortMapping 接口,并扩展了 WebviewOptions 接口。新接口允许在 webview 中配置本地主机端口映射,提供了一种结构化的方式来管理 webview 内容的网络请求和端口连接。此外,还添加了对文档过滤和工作区信任的提议类型的引用,并删除了一些与工作区信任和文档过滤相关的旧类型定义。

变更

文件 变更描述
packages/types/vscode/typings/vscode.d.ts 添加 WebviewPortMapping 接口
WebviewOptions 中新增可选的 portMapping 属性
添加对 vscode.proposed.documentFiltersExclusive.d.tsvscode.proposed.workspaceTrust.d.ts 的引用
packages/types/vscode/typings-pending/vscode.d.ts 删除 ProviderResult<T> 类型定义
删除 WebviewPortMapping 接口
packages/types/vscode/typings-pending/vscode.proposed.d.ts 删除 DocumentFilter 接口
删除 WorkspaceTrustRequestOptions 接口
删除 requestWorkspaceTrust 函数
packages/types/vscode/typings/vscode.proposed.documentFiltersExclusive.d.ts 更新 DocumentFilter 接口,新增可选的 exclusive 属性
packages/types/vscode/typings/vscode.proposed.workspaceTrust.d.ts 添加 WorkspaceTrustRequestOptions 接口
添加 requestWorkspaceTrust 函数

序列图

sequenceDiagram
    participant Extension
    participant VSCode
    participant Webview
    participant LocalServer

    Extension->>VSCode: 配置 WebviewOptions
    VSCode->>Webview: 应用端口映射
    Webview->>LocalServer: 通过映射的端口连接
Loading

这个序列图展示了扩展如何通过 portMapping 配置 webview 的端口映射,VSCode 随后应用这些映射,使 webview 能够更灵活地连接本地服务器。


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/types/vscode/typings/vscode.d.ts (1)

942-956: 建议:为端口值添加更清晰的约束或说明。

在现有定义中,webviewPortextensionHostPort 都是必填且只读,但未明确端口范围(如 165535)。如果可能,建议在 jsdoc 注释或类型定义处说明有效端口范围,减少后续端口是否合法导致的潜在问题。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between efc1aef and 7c889bc.

📒 Files selected for processing (1)
  • packages/types/vscode/typings/vscode.d.ts (1 hunks)

Copy link

codecov bot commented Jan 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.21%. Comparing base (2069c51) to head (0b87479).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4295      +/-   ##
==========================================
- Coverage   54.25%   54.21%   -0.05%     
==========================================
  Files        1633     1634       +1     
  Lines       99820    99917      +97     
  Branches    21667    21691      +24     
==========================================
+ Hits        54155    54167      +12     
- Misses      37943    38007      +64     
- Partials     7722     7743      +21     
Flag Coverage Δ
jsdom 49.74% <ø> (-0.04%) ⬇️
node 12.24% <ø> (-0.02%) ⬇️

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.

@hacke2
Copy link
Member

hacke2 commented Jan 2, 2025

WebviewPortMapping 应该是没有实现的

@hui2334387208 hui2334387208 changed the title Chores: update WebviewPortMapping type feat: empty impl VSCode WebviewPortMapping API Jan 3, 2025
@hui2334387208 hui2334387208 changed the title feat: empty impl VSCode WebviewPortMapping API Chores: update WebviewPortMapping type Jan 3, 2025
@hui2334387208 hui2334387208 changed the title Chores: update WebviewPortMapping type chore: update WebviewPortMapping type Jan 3, 2025
@hui2334387208 hui2334387208 changed the title chore: update WebviewPortMapping type chore: update WebviewPortMapping、DocumentFilter、WorkspaceTrustRequestOptions、requestWorkspaceTrust type Jan 3, 2025
@hui2334387208
Copy link
Contributor Author

WebviewPortMapping 应该是没有实现的

Webview 实现类中options参数中使用

@hui2334387208 hui2334387208 changed the title chore: update WebviewPortMapping、DocumentFilter、WorkspaceTrustRequestOptions、requestWorkspaceTrust type chore: update WebviewPortMapping and proposed type Jan 3, 2025
@bk1012 bk1012 merged commit c174571 into opensumi:main Jan 3, 2025
13 checks passed
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.

3 participants