Feature: check_code tool to flag deprecated and anti-pattern Unity APIs with line numbers

Đang mở
#39 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp, unity
Lĩnh vực
game-dev, tooling

Hướng nghiên cứu

Start by locating deprecated_patterns.json, the existing lookup_api MCP tool, and the performance-optimization and csharp rules mentioned in the issue. Define the scanner and data schema around those entry points, then add a fixture covering each listed pattern and verify the reported line numbers, replacements, and reasons. Done means check_code flags every fixture pattern with the correct line number.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

feature mcp-server priority: medium

Why it matters

deprecated_patterns.json already maps legacy APIs to replacements, but it is only used as a side-warning in lookup_api. Developers upgrading to Unity 6 (or AI agents reviewing code) want "scan this file and tell me what to change". That is concrete, high-value, and easy to demo.

Proposal

New MCP tool check_code(code | file_path):

  • Regex/token match against deprecated_patterns.json plus new Unity 6 renames (velocity -> linearVelocity, drag -> linearDamping, FindObjectsOfType -> FindObjectsByType, CGPROGRAM in URP, Camera.main in Update, GetComponent in Update, GameObject.Find in hot paths, async void outside event handlers, new WaitForSeconds in loops).
  • Returns line numbers, the replacement, and a reason, optionally with a suggested patch.
  • Extend the data schema with pattern (regex), severity, autofix.

Stretch: ship the same patterns as a Roslyn analyzer package for Unity, so the checks run in the editor and CI too.

Done when

check_code flags every pattern in a fixture file with correct line numbers, and the performance-optimization and csharp rules point the agent at it.

Ngôn ngữ chính
C#
Star
4
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TMHSDigital/Unity-Developer-Tools

Tất cả issue của TMHSDigital/Unity-Developer-Tools

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.