refactor: extract Monaco setup and completion providers from QueryEditor
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- react, typescript
调研方向
Start with src/components/editor/QueryEditor.tsx and locate the Monaco setup, JOIN and schema completion providers, intention actions, and live-template expansion. Read the existing editor lifecycle and useLiveTemplates usage before deciding how their dependencies are registered and disposed. The requested files are monacoSetup.ts, sqlCompletionProvider.ts, intentionActions.ts, and liveTemplateProvider.ts alongside the component. Done means the component is under roughly 600 lines, the listed features still work, checks pass, and a Vitest test covers pure live-template expansion.
由索引模型根据 Issue 内容生成。
描述
src/components/editor/QueryEditor.tsx is 1,179 lines. The component itself is fine; the noise is Monaco configuration, language definitions, JOIN suggestion providers, and intention actions inlined alongside the React lifecycle.
What to extract
monacoSetup.ts— theme registration, language token registration, editor option defaults.sqlCompletionProvider.ts— the JOIN-via-foreign-key autocomplete and the schema-aware identifier suggestions.intentionActions.ts— the Alt+Enter "intention actions" (quick fixes / refactors offered in the editor).liveTemplateProvider.ts— the snippet expansion that consumesuseLiveTemplates.
Suggested approach
- Files live in
src/components/editor/next to QueryEditor.tsx. - Each provider is a pure function that takes its dependencies (current schema, FK map, templates) and returns a Monaco-registered disposable.
- QueryEditor.tsx orchestrates the disposables in a single
useEffect.
Done criteria
QueryEditor.tsxdrops below ~600 lines.- All editor features still work: JOIN suggestions, table/column autocomplete, Alt+Enter actions, live templates.
- TypeScript / tests / build green.
- One Vitest test for the live-template expander (pure-string logic).
Out of scope
- Switching to a different editor (CodeMirror, etc.).
- Adding language servers / LSP.
Audit reference
K5 in the pre-launch audit.
- 主要语言
- TypeScript
- 星标
- 6
- 派生
- 1
- 平均合并
- 17 分钟
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
openidle-dev/queryden 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
openidle-dev/queryden#240 ·
-
bug enhancement
难度 2/5 1-3 小时 新手友好度 76/100
openidle-dev/queryden#187 ·
-
难度 2/5 1-3 小时 新手友好度 58/100
openidle-dev/queryden#237 ·
-
难度 4/5 3-5 天 新手友好度 55/100
openidle-dev/queryden#192 ·
-
dependencies
难度 2/5 1-3 小时 新手友好度 58/100
openidle-dev/queryden#186 ·
查看 openidle-dev/queryden 的全部 Issue
相似的 Issue
-
Mend: dependency security vulnerability
难度 1/5 1-3 小时 新手友好度 65/100
fdm-monster/fdm-monster#5563 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
难度 2/5 1-3 小时 新手友好度 65/100
growilabs/growi#12246 · 3 条评论 ·
维护者通常 1 天内回复
-
🐛 The Rulekeeper - An index run that gives up on the lock ends Succeeded可能已有人在做 @github-actions 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
SSWConsulting/SSW.Rules#2809 · 1 条评论 ·
维护者通常 1 天内回复