-
Notifications
You must be signed in to change notification settings - Fork 308
[v1.3?] VSCodeConnect 代码优化 #947
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
Open
cyfung1031
wants to merge
8
commits into
scriptscat:release/v1.3
Choose a base branch
from
cyfung1031:pr-vscodeConnect-001
base: release/v1.3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[v1.3?] VSCodeConnect 代码优化 #947
cyfung1031
wants to merge
8
commits into
scriptscat:release/v1.3
from
cyfung1031:pr-vscodeConnect-001
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73c1f7f to
40777de
Compare
40777de to
ea13c13
Compare
ea13c13 to
a849db0
Compare
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
这个 PR 对 VSCodeConnect 服务进行了重构,目的是优化代码结构和提高可维护性。主要改进包括提取类型定义、重构连接逻辑、改进访问修饰符使用,以及增强错误处理。
主要变更:
- 提取了
VSCodeConnectParam类型定义,提高了类型复用性和可读性 - 重构了 WebSocket 连接和重连逻辑,将嵌套的回调改为更清晰的结构
- 添加了私有访问修饰符,改进了封装性
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 14 comments.
| File | Description |
|---|---|
src/app/service/service_worker/client.ts |
更新了 SystemClient 的 connectVSCode 方法类型定义,使用新提取的 VSCodeConnectParam 类型 |
src/app/service/offscreen/vscode-connect.ts |
主要重构文件:提取类型定义、添加访问修饰符、重构连接和重连逻辑、改进消息处理结构 |
src/app/service/offscreen/index.ts |
更新 VSCodeConnect 实例化方式,传递 Server 对象而不是 Group 对象 |
src/app/service/offscreen/client.ts |
更新 VscodeConnectClient 的 connect 方法类型定义 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
概述 Descriptions
变更内容 Changes
截图 Screenshots