Editor 工作流
Antigravity Editor View 的日常工作流:補全、Tab、inline command、terminal command、agent side panel、Problems 和上下文引用。
Editor View 保留了 VS Code 類 IDE 的肌肉記憶:檔案樹、編輯器、終端、Problems、擴充套件、補全和命令。Antigravity 的差異是:這些傳統入口可以和 agent side panel、inline command、terminal command、Artifacts 和 Manager Surface 串起來。
這一頁解決什麼問題:你在 Editor 裡應該把 Antigravity 當成“區域性協作工具”,而不是把所有任務都扔進 Agent Manager。
1. Editor 適合的任務
| 任務 | 推薦入口 | 原因 |
|---|---|---|
| 改一個函式 | inline command 或 side panel | 上下文足夠小 |
| 解釋報錯 | hover 的 Explain and fix 或 Problems | 錯誤位置明確 |
| 生成一段命令 | terminal command | 直接貼近 shell |
| 讓 agent 看當前檔案 | side panel + 檔案引用 | 避免開啟過大 workspace |
| 小範圍重構 | Editor + diff review | 人能快速讀完 diff |
2. Tab 補全
Codelab 展示了幾個 Editor 補全能力:
- 普通程式碼補全:寫程式碼時按 Tab 接受建議。
- Tab to import:提示補缺失依賴或 import。
- Tab to jump:跳到下一個合理編輯點。
這些能力更像“區域性加速”,不適合替代完整任務規劃。你可以把它當成普通 IDE 智慧補全,而不是每次都啟動 agent。
3. Inline command
官方 Codelab 展示可以在 editor 或 terminal 中用自然語言觸發 command。常見模式:
选中一段代码 → Cmd + I(Mac)/ Ctrl + I(Windows)→ 让 Antigravity 重写、解释或生成替代实现適合:
- 改寫函式
- 補註釋
- 解釋一段複雜邏輯
- 生成一個測試樣例
- 把 terminal 輸出轉成排障步驟
不適合:
- 改整個目錄
- 設計完整架構
- 運算元據庫
- 修改部署配置
4. Agent side panel
Editor 中的 side panel 適合“當前檔案 + 少量上下文”的協作。你可以用 @ 引用檔案、目錄或其他上下文,也可以用 / 觸發 workflow。
flowchart LR
File["當前檔案"] --> Panel["Agent side panel"]
Problem["Problems / terminal output"] --> Panel
Mention["@file / @folder"] --> Panel
Workflow["/workflow"] --> Panel
Panel --> Diff["區域性 diff"]
Diff --> Review["人工 review"]
如果你發現自己在 side panel 裡描述了 10 個步驟、多個頁面、多個驗證動作,這個任務應該切到 Planning 或 Agent Manager。
5. Problems 與 terminal output
Antigravity 可以從 Problems 面板把錯誤交給 agent,也可以把 terminal 輸出發給 agent。正確用法是:
- 先保留原始錯誤,不要手動刪掉關鍵日誌。
- 讓 agent 解釋“錯誤發生在哪一層”。
- 要求它給最小修複方案。
- 修完後重新跑同一命令驗收。
示例 prompt:
解释这段 terminal output。请先判断是依赖、配置、类型还是运行时问题。
只给最小修复方案,不要修改无关文件。6. Editor 與 Manager 的切換
Codelab 展示可以在 Editor 和 Agent Manager 間切換。實務上可以這樣分:
| 當前狀態 | 留在 Editor | 切到 Agent Manager |
|---|---|---|
| 你知道要改哪一段 | ✅ | |
| 任務需要瀏覽器驗收 | ✅ | |
| 任務要跑測試和生成 walkthrough | ✅ | |
| 只是解釋一個錯誤 | ✅ | |
| 需要同時開多個 workspace | ✅ |
官方來源
交付標準
Editor 工作流完成後,應該留下可 review 的區域性 diff,而不是隻得到一段解釋。最小標準是:你能說清用了哪個入口、agent 讀取了哪些上下文、改動影響哪些檔案、復跑了哪個命令或手動檢查。只要任務開始涉及多檔案、多步驟瀏覽器驗證或持續觀察,就把它升級到 Agent Manager。