使用 AI 重構單體 C# 類別
連接 GitHub 儲存庫
提供 GitHub 倉庫 URL 和 OAuth 令牌。助理會克隆該倉庫,索引 C# 檔案,並為重構所選類別做準備。
Processing Your File
File: -
Folder: -
Uploading... 0%
0 100
Please wait while we process your file...
While you wait: New: Documentize Cloud — document pipelines as code Chain convert, OCR, merge and AI steps into one YAML pipeline and run it hosted, serverless or on your own servers. Try Documentize Cloud →
Processing Complete!
Your files are ready for download.
Found 0 files
Need this again? New: Documentize Cloud — document pipelines as code Chain convert, OCR, merge and AI steps into one YAML pipeline and run it hosted, serverless or on your own servers. Try Documentize Cloud →
Processing Failed
An error occurred during processing.
選擇一個 GitHub 儲存庫和目標類別。我們的 AI 會提取隱藏的職責,建立新服務,重新接線程式碼,驗證建置,並為您開啟 PR。
New: Documentize Cloud — document pipelines as code Chain convert, OCR, merge and AI steps into one YAML pipeline and run it hosted, serverless or on your own servers. Try Documentize Cloud →
Refactor Assistant 如何運作
1. 連接您的 GitHub 儲存庫
輸入儲存庫 URL 並授予存取權限。系統會將儲存庫克隆到安全的沙箱中。
2. 選擇目標類別
選擇一個大型 C# 類別(例如,>500 行),您想將其拆分為較小的服務。
3. AI 分析職責
模型檢查方法、欄位和使用模式,以辨識不同的職責與領域概念。
4. 生成服務類別與重新接線程式碼
AI 建立新的服務檔案,移動相關方法,更新建構子,注入依賴,並重寫呼叫者。
5. 驗證建置與測試
助理執行 `dotnet build` 並執行現有的單元測試,以確保重構不會破壞功能。
6. 開啟合併請求
已推送包含重構程式碼的新分支,並已開啟 PR,準備審核。
FAQs
支援哪些程式語言?
目前支援 C#(.NET 5‑8)專案。未來版本將加入 VB.NET 與 F#。
我需要給予完整的儲存庫存取權限嗎?
僅允許讀取權限以進行克隆,並允許對新分支和拉取請求的寫入權限。現有分支不會被修改。
AI 如何確保重構能順利建置?
在代碼變更後,助理會在隔離容器中執行 `dotnet restore`、`dotnet build` 以及所有專案測試。錯誤會在建立 PR 之前報告。
我的原始檔案已被儲存嗎?
所有程式碼皆在暫時的沙箱中於記憶體內處理,並於會話結束後刪除。未保留任何來源,也不會用於訓練。
我可以控制責任如何分配嗎?
是的。您可以在 AI 生成重構計畫之前提供提示或指定目標服務名稱。
AI 責任抽取
對方法、欄位和使用模式進行語意分析,以發現邏輯邊界。
自動化服務生成
生成新的 .cs 檔案,更新 DI 容器,並自動重新連結所有引用。
建置 & 測試驗證
在建立 PR 之前,於隔離環境中執行完整建置與單元測試套件。