Skip to content

Add C# language support #79

Description

@DataDave-Dev

🇪🇸 Español

Agregar soporte para C# generando un call graph (funciones/métodos como nodos, llamadas como aristas), siguiendo la arquitectura pluggable.

Por qué encaja

  • El grammar ya viene incluido: node_modules/tree-sitter-wasms/out/tree-sitter-c_sharp.wasm — solo hay que copiarlo a public/wasm/ (no hay que compilar nada).
  • C# es un call-graph clásico con clases/métodos/herencia, así que encaja en el patrón LangSpec + analyzeProjectWith (como los analyzers de JavaScript/TypeScript).

Tareas

  • Copiar tree-sitter-c_sharp.wasm a public/wasm/.
  • Crear src/lib/analysis/analyzers/csharp.ts con un LangSpec: definiciones de métodos/funciones locales, clases (class_declaration), llamadas (invocation_expression), extends/interfaces (lista de bases) y using para imports.
  • Registrarlo en registry.ts y cablear EXT/PROJECT_EXTS (.cs), selector + sample en CodeWorkspace, y los chips de Hero/Features.
  • Tests en analyzers.test.ts (call graph entre archivos, clases/herencia, grafo vacío).
  • Actualizar docs (Languages.tsx) y README (en/es).

Punto de partida: mirar los analyzers existentes typescript.ts/javascript.ts (tienen clases) y el PR de Rust (#77) como referencia del cableado.


🇬🇧 English

Add C# support, generating a call graph (functions/methods as nodes, calls as edges), following the pluggable architecture.

Why it fits

  • The grammar is already bundled: node_modules/tree-sitter-wasms/out/tree-sitter-c_sharp.wasm — just copy it to public/wasm/ (no build needed).
  • C# is a classic call graph with classes/methods/inheritance, so it fits the LangSpec + analyzeProjectWith pattern (like the JavaScript/TypeScript analyzers).

Tasks

  • Copy tree-sitter-c_sharp.wasm into public/wasm/.
  • Create src/lib/analysis/analyzers/csharp.ts with a LangSpec: method/local-function defs, classes (class_declaration), calls (invocation_expression), extends/interfaces (base list), and using for imports.
  • Register it in registry.ts and wire EXT/PROJECT_EXTS (.cs), the selector + sample in CodeWorkspace, and the Hero/Features chips.
  • Tests in analyzers.test.ts (cross-file call graph, classes/inheritance, empty graph).
  • Update docs (Languages.tsx) and README (en/es).

Starting point: look at the existing typescript.ts/javascript.ts analyzers (they have classes) and the Rust PR (#77) for the wiring reference.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions