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

Aberta
#39 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
35/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
csharp, unity
Domínio
game-dev, tooling

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
C#
Estrelas
4
Forks
0
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/Unity-Developer-Tools

Todas as issues de TMHSDigital/Unity-Developer-Tools

Issues semelhantes

Mais issues de C#

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.