Skip to content

Commit c040b3b

Browse files
authored
Merge pull request #69 from spencerkit/develop
Stabilize CI verification on develop
2 parents d362094 + 3a4f1fa commit c040b3b

311 files changed

Lines changed: 54801 additions & 12757 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/bright-owls-merge.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@spencer-kit/coder-studio": patch
3+
---
4+
5+
Improve workspace, diagnostics, monitoring, and editor workflows with system
6+
dependency installs, managed Vue LSP support, file history previews, and
7+
refined settings and workspace surfaces.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,8 @@ tsconfig.tsbuildinfo
6868

6969
# Stitch design files
7070
.stitch/
71+
72+
# Rust build artefacts (from lsp-test/ fixture or any ad-hoc cargo)
73+
target/
74+
Cargo.lock
75+
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# rust-analyzer 启动期间 hover/definition 静默无响应,UI 无进度反馈
2+
3+
## 标题
4+
5+
`feat(web): surface rust-analyzer indexing progress in the LSP status notice`
6+
7+
## 问题描述
8+
9+
打开第一个 `.rs` 文件时,rust-analyzer 会进入 `PrimeCaches` 阶段对工作区做初始化索引。这个阶段在 coder-studio 仓库根(中等仓库 + 大量 `node_modules`)下实测**会持续 ~25 秒**
10+
11+
期间:
12+
13+
- `initialize` LSP 请求几十毫秒就返回(rust-analyzer 设计上立刻确认 capabilities,workspace 加载是异步的)
14+
- 我们的 `LspManager.ensureSession` 拿到 `summary.status === "ready"`,前端把 hover/definition provider 都注册好
15+
- 但用户**任何** hover/definition 请求都会被 rust-analyzer **立刻返回 `null`**——不是 hang、不是 timeout,而是它故意在 indexing 期间不给语义答案
16+
- Monaco 拿到 null 就什么都不显示
17+
- 用户感受:开了 `.rs` 文件之后随便点点都"完全没反应",像 LSP 没起来
18+
19+
25 秒后 rust-analyzer 发 `$/progress { kind: "end" }` 通知,从此 hover 正常工作。但**这中间的等待期对用户完全不可见**
20+
21+
## 复现步骤
22+
23+
1. 干净环境,无 rust-analyzer 缓存。
24+
2. 在 coder-studio 仓库根新建 `Cargo.toml` + `probe.rs`(最小 bin 项目即可)。
25+
3. 重启 dev server,让 LSP 会话从干净状态启动。
26+
4. 浏览器中打开 `probe.rs`,立刻 hover 任一标识符。
27+
5. 观察前 ~25 秒所有 hover/definition/references 都没反应。
28+
29+
可以用 `scripts/probe-rust.mjs probe.rs` 直接复现 ——
30+
它会同时记录 initialize 用时、首次 hover 响应、`$/progress end` 用时。
31+
32+
## 实际行为
33+
34+
- 前 25 秒:hover 返回 null,UI 安静
35+
- 之后:hover 工作,但用户多半已经放弃尝试了
36+
37+
## 桌面终端对比
38+
39+
VS Code 的官方 rust-analyzer 扩展会在 status bar 上显示
40+
`rust-analyzer: indexing X/Y` 进度条;Helix 会在底部状态栏显示同样信息。两者都监听 rust-analyzer
41+
`$/progress` LSP 通知。
42+
43+
我们目前没监听任何 LSP 进度通知。
44+
45+
## 已确认事实
46+
47+
- `initialize` 响应快(~70ms 量级,与 indexing 解耦)
48+
- rust-analyzer 通过标准 LSP `$/progress`
49+
notification 通报进度,token 是 `"rustAnalyzer/Indexing"` 或类似
50+
- `LspSession``packages/server/src/lsp/session.ts`)目前没有 `connection.onNotification("$/progress", ...)`
51+
处理器
52+
- 前端 `LspStatusNotice` 目前只有 ready / installing / failed / disabled 四种状态显示
53+
54+
## 后续排查方向
55+
56+
- **server**`LspSession` 监听 `$/progress` 通知,把 `WorkDoneProgressBegin` /
57+
`WorkDoneProgressReport` / `WorkDoneProgressEnd` 转成 `lsp.progress.updated` 事件
58+
via `eventBus`
59+
- **core / shared**:在 `LspEnsureSessionResult` 或独立 `LspProgress` 类型里加一个 "indexing" 状态
60+
- **web**`LspStatusNotice` 渲染 "Indexing 12 / 47 …" 或简单的 spinner + percentage
61+
- 范围只对 rust-analyzer + 任何主动发 `$/progress` 的 server(pylsp、gopls 通常不发)
62+
63+
## 临时缓解
64+
65+
- 文档里告诉用户:"首次打开 `.rs` 文件需要等 ~30s 完成索引"
66+
- 或检测 rust-analyzer 没回有效 hover 时,在编辑器里给一个 transient toast 提示
Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
# VS Code Plugin Ecosystem Evaluation
2+
3+
> Status: Research
4+
> Date: 2026-05-26
5+
> Scope: VS Code plugin ecosystem adoption, UI freedom trade-offs, and Theia fit for Coder Studio
6+
7+
## Goal
8+
9+
Record the current product and architecture conclusions for a future decision on whether Coder Studio should move toward the VS Code plugin ecosystem.
10+
11+
This document is a research memo, not an implementation spec.
12+
13+
## Current Product Baseline
14+
15+
Coder Studio currently behaves as a custom browser workspace rather than a VS Code-derived workbench.
16+
17+
Relevant local references:
18+
19+
- Browser workspace positioning: [README.zh-CN.md](../../../README.zh-CN.md)
20+
- Product shell and route model: [docs/PRD.zh-CN.md](../PRD.zh-CN.md)
21+
- Desktop shell: [packages/web/src/shells/desktop-shell.tsx](../../../packages/web/src/shells/desktop-shell.tsx)
22+
- Mobile shell: [packages/web/src/shells/mobile-shell/index.tsx](../../../packages/web/src/shells/mobile-shell/index.tsx)
23+
- Desktop workspace composition: [packages/web/src/features/workspace/views/desktop/workspace-desktop-view.tsx](../../../packages/web/src/features/workspace/views/desktop/workspace-desktop-view.tsx)
24+
- Mobile workspace composition: [packages/web/src/features/workspace/views/mobile/workspace-mobile-view.tsx](../../../packages/web/src/features/workspace/views/mobile/workspace-mobile-view.tsx)
25+
26+
Current product traits that matter for this evaluation:
27+
28+
- custom desktop shell
29+
- custom mobile shell
30+
- route-driven pages such as welcome, login, workspace, settings, diagnostics
31+
- mobile-first `Dock + Sheet` workspace flow
32+
- agent/session/supervisor/review workflow integrated into a custom app shell
33+
34+
## Core Conclusion
35+
36+
Two goals conflict with each other:
37+
38+
1. maximize VS Code plugin compatibility
39+
2. preserve the current Coder Studio UI freedom
40+
41+
They cannot both be optimized at the same time.
42+
43+
The practical decision boundary is:
44+
45+
- If plugin compatibility is the highest priority, the workbench shell must move closer to VS Code or a VS Code-compatible platform.
46+
- If current UI freedom is the highest priority, Coder Studio can only reuse VS Code-adjacent protocol and editor capabilities, not the full plugin ecosystem.
47+
48+
## What "Highest Plugin Compatibility" Implies
49+
50+
If Coder Studio wants the strongest possible compatibility with the VS Code extension ecosystem, the product shell must largely yield to a VS Code-style workbench model.
51+
52+
Implications:
53+
54+
- main shell follows workbench conventions instead of a custom page shell
55+
- extension lifecycle and contribution points become host-driven
56+
- files/search/scm/terminal/commands/preferences should use workbench-native surfaces
57+
- custom product features should live inside views, widgets, panels, commands, and webviews instead of owning the whole page layout
58+
59+
This direction improves extension compatibility, but reduces control over:
60+
61+
- overall shell layout
62+
- global DOM and CSS ownership
63+
- fully custom page routing as the main experience
64+
- the current independent mobile `Dock + Sheet` interaction model
65+
66+
## What "Keep Current UI Freedom" Implies
67+
68+
If Coder Studio keeps its current UI freedom, it can still adopt selected VS Code-adjacent capabilities:
69+
70+
- Monaco editor services
71+
- LSP-backed language intelligence
72+
- DAP-backed debugger plumbing
73+
- syntax themes, snippets, and editor-level enhancements
74+
- selected VS Code-like services via `monaco-vscode-api`
75+
76+
But it cannot honestly promise:
77+
78+
- broad compatibility with existing VS Code extensions
79+
- full workbench contribution support
80+
- strong compatibility for extensions that need a full extension host, Node runtime, terminal integration, SCM integration, or workbench UI contracts
81+
82+
In short:
83+
84+
- preserve UI freedom -> reuse protocols and editor services
85+
- maximize extension compatibility -> adopt a workbench platform
86+
87+
## Option Comparison
88+
89+
### Option A: OpenVSCode Server / code-server style foundation
90+
91+
Strengths:
92+
93+
- highest extension compatibility
94+
- closest to real VS Code workbench behavior
95+
- least ambiguity about extension host expectations
96+
97+
Costs:
98+
99+
- current Coder Studio shell must largely give way to the workbench shell
100+
- mobile-first interaction model is heavily reduced
101+
- custom product UI becomes embedded features inside the workbench, not the main shell
102+
103+
Best fit when:
104+
105+
- extension compatibility is more important than product shell freedom
106+
107+
### Option B: Theia
108+
109+
Strengths:
110+
111+
- meaningful VS Code extension compatibility
112+
- more shell and layout customization than a strict VS Code workbench route
113+
- supports custom frontend/backend extensions in addition to VS Code-style plugins
114+
- better fit for a hybrid product that still wants a distinct identity
115+
116+
Costs:
117+
118+
- current route-driven shell still needs major refactoring
119+
- desktop can be adapted, but mobile-specific shell patterns should not be assumed to map cleanly
120+
- compatibility is good but not equal to official VS Code
121+
122+
Best fit when:
123+
124+
- the product wants a serious extension ecosystem story without fully surrendering product-level customization
125+
126+
### Option C: Keep current architecture + `monaco-vscode-api`
127+
128+
Strengths:
129+
130+
- highest UI freedom
131+
- lowest shell disruption
132+
- best preservation of the current mobile and cross-device product language
133+
134+
Costs:
135+
136+
- extension compatibility remains limited
137+
- many workbench responsibilities become self-owned platform work
138+
- long-term maintenance cost is high because Coder Studio would be building a partial compatibility layer itself
139+
140+
Best fit when:
141+
142+
- product UI freedom is more important than extension ecosystem breadth
143+
144+
## Recommended Position
145+
146+
Based on the current discussion:
147+
148+
- OpenVSCode-style foundation is the right answer only if extension compatibility clearly outweighs UI freedom.
149+
- Theia is the best compromise if the product wants both some VS Code extension compatibility and some product-level UI control.
150+
- Staying self-built is only the right answer if the team explicitly chooses product shell freedom over extension compatibility.
151+
152+
For the current priority ordering discussed in research:
153+
154+
- `plugin compatibility first`
155+
- `do not fully lose all product customization`
156+
157+
The best-fit direction is **Theia**, with the explicit understanding that this is still a compromise and not full VS Code equivalence.
158+
159+
## Theia-Specific UI Impact
160+
161+
If Coder Studio moves to Theia, the product should not plan on lifting the current UI into Theia unchanged.
162+
163+
### UI areas that must be restructured
164+
165+
- The current page shell model should be replaced by a Theia `ApplicationShell + widgets` model.
166+
- `DesktopShell` and `MobileShell` should no longer be treated as peer top-level app shells.
167+
- `/workspace` should stop being the dominant page abstraction.
168+
- `/settings` should split into standard preferences plus one or more custom product widgets.
169+
- `QuickOpen` and `CommandPalette` should stop competing with workbench-native command surfaces.
170+
171+
### Desktop changes likely required
172+
173+
- `TopBar` should shrink dramatically or disappear as a product-owned global shell.
174+
- custom workspace tabs should likely move to commands, switchers, or a dedicated widget
175+
- files/search/source control should prefer workbench-native views where possible
176+
- status strip should be decomposed into status bar items
177+
- custom panels should be repackaged as Theia widgets, not page regions
178+
179+
### Mobile changes likely required
180+
181+
This is the largest UI loss area.
182+
183+
Current mobile behavior is a dedicated product model:
184+
185+
- top bar
186+
- single active session surface
187+
- bottom dock
188+
- fullscreen sheets for files, terminal, supervisor, and agent session selection
189+
190+
This model should not be assumed to transfer cleanly to Theia.
191+
192+
Research conclusion:
193+
194+
- desktop workbench migration and mobile-shell preservation should be treated as separate concerns
195+
- if mobile is strategically important, keep a separate mobile-optimized frontend rather than forcing Theia to become the mobile shell
196+
197+
This mobile conclusion is an engineering judgment based on Theia's documented workbench and layout model, not a direct vendor promise.
198+
199+
## Practical Mapping of Current UI to Theia
200+
201+
Likely mapping:
202+
203+
- welcome/start flow -> startup widget or launch dialog
204+
- diagnostics -> dedicated widget or command-driven surface
205+
- settings page -> preferences plus custom settings widget
206+
- left activity/sidebar -> Theia view container(s)
207+
- agent/session/supervisor/review -> custom Theia widgets
208+
- bottom terminal panel -> Theia terminal integration or a wrapped custom terminal widget
209+
- footer status strip -> status bar items
210+
211+
Should not be treated as first-class Theia shell concepts:
212+
213+
- current route-driven workspace page
214+
- custom top-level desktop/mobile shell split
215+
- mobile `Dock + Sheet` shell as the primary workbench model
216+
217+
## Decision Triggers For Later
218+
219+
Use this memo to revisit the decision when the team can answer these questions:
220+
221+
1. Is extension compatibility more important than keeping the current mobile-first product shell?
222+
2. Is partial extension compatibility sufficient, or does the team need as much real-world VS Code extension coverage as possible?
223+
3. Is the product willing to split desktop and mobile into different frontend strategies?
224+
4. Does the team want to own a partial compatibility platform over time?
225+
226+
## Research Sources
227+
228+
Official and primary references used in this evaluation:
229+
230+
- VS Code Extension Host: https://code.visualstudio.com/api/advanced-topics/extension-host
231+
- VS Code Extension Capabilities: https://code.visualstudio.com/api/extension-capabilities/overview
232+
- VS Code Web Extensions: https://code.visualstudio.com/api/extension-guides/web-extensions
233+
- VS Code Language Server Extension Guide: https://code.visualstudio.com/api/language-extensions/language-server-extension-guide
234+
- VS Code Debugger Extension Guide: https://code.visualstudio.com/api/extension-guides/debugger-extension
235+
- Theia Extensions: https://theia-ide.org/docs/extensions/
236+
- Theia Frontend Application Contributions: https://theia-ide.org/docs/frontend_application_contribution/
237+
- Theia Architecture: https://theia-ide.org/docs/architecture/
238+
- `monaco-vscode-api`: https://github.com/CodinGame/monaco-vscode-api
239+
240+
## Final Summary
241+
242+
The current research position is:
243+
244+
- full UI freedom and highest extension compatibility are mutually competing goals
245+
- VS Code-compatible workbench routes favor compatibility over shell freedom
246+
- self-built routes favor shell freedom over compatibility
247+
- Theia is the strongest compromise for Coder Studio if the team wants a serious plugin story without fully collapsing into a pure VS Code shell
248+
- a future Theia path should treat desktop and mobile as different product surfaces rather than assuming one shell serves both equally well

0 commit comments

Comments
 (0)