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

Offen
#39 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
csharp, unity
Bereich
game-dev, tooling

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
C#
Sterne
4
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TMHSDigital/Unity-Developer-Tools

Alle Issues in TMHSDigital/Unity-Developer-Tools

Ähnliche Issues

Weitere Issues zu C#

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.