AI Code Generator for Visual Studio 2022Use AI to generate plans and patches for your entire project, simply via a prompt. AI Code Generator is a Visual Studio 2022 extension for AI-assisted software development with local or remote language models. It turns a development goal into a reviewable plan, generates one patch at a time, validates C# with Roslyn, builds the solution once at the end of the workflow, and can request bounded repair patches when compilation fails. The extension supports English and German and follows the active Visual Studio color theme.
Features
Providers
The provider interface is intentionally transport-agnostic. Custom OpenAI-compatible endpoints can be added directly under Tools > AI Code Generator Settings without changing the workflow coordinators. Architecture
The Visual Studio extension is a UI host. Workflow state and filesystem mutations live in the backend so approval, execution, compilation, repair, and persistence remain separated. Language analysisThe context resolver starts with each plan step's explicit targets, adds nearby project manifests, and builds a transitive dependency graph before applying heuristic ranking. It follows Python imports, Composer PSR-4 and PHP includes, JavaScript/TypeScript imports and path aliases, C# namespaces and referenced types, MSBuild project items, XAML code-behind links, HTML assets, and CSS imports. Context selection remains bounded by the active provider's file and token budgets. Dependencies that do not fit are listed explicitly in the request as omitted, so the model can request a narrower follow-up step.
External validation commands are selected by registered backends. Model output can never provide an executable or arbitrary command-line arguments. If an optional interpreter cannot start or does not finish its syntax check within the validator timeout, AI Code Generator falls back to deterministic structural validation. An internal validator timeout is not treated as a user cancellation and cannot mark an unapplied patch as retained. Windows App Execution Alias messages such as "Python was not found" are treated as unavailable validator infrastructure, never as source-code syntax errors. |
