What is the Kotlin Analysis API?
The Kotlin Analysis API is a library for analyzing Kotlin code. It's an interface to the compiler front-end that lets tools inspect class members, resolve types and calls, read diagnostics, or access other semantic information without running the full compiler. It powers the whole Kotlin plugin for IntelliJ IDEA, the Kotlin language server, and utilities such as Kotlin Symbol Processing or Android Lint.
Why this project matters
Even though IntelliJ IDEA and the Kotlin compiler share the code analyzer, they differ in how and when analysis runs. Sometimes correct code is highlighted as an error in the IDE, and other times, real errors slip through. We have automated tests for diagnosing such issues in larger projects (including IntelliJ IDEA itself), but isolating a small, repeatable case is often tedious.
Bugs and regressions are far easier to fix with minimal, shareable repros. Today, engineers attach entire projects or have to hand-minimize code, which is slow and error-prone. This project dogfoods the Analysis API to automate that process. It should cut triage time dramatically, raise the quality of bug reports, and make it easier for both JetBrains and the community to diagnose issues.
The goal
Provide a plugin with two intentions: Extract reproducer and Minimize reproducer.
Extract reproducer copies the relevant file and its required dependencies (libraries and source, within a configurable depth) into a temporary, standalone project and verifies that the same diagnostic occurs.
Minimize Reproducer then iteratively simplifies the example, deleting or stubbing declarations and shrinking expressions, while continuously checking that the diagnostic still appears in the IDE. The result is a small, shareable project that reliably reproduces the problem.
Prior Research
JetBrains has experimented with Kotlin repro minimization in the past. ReduKtor is a research prototype similar to C-Reduce for Kotlin. The article shows the approach's usefulness for real compiler issues. Project Minimization extended this with an IDE intention for code minimization.
Those efforts focus on compiler failures (e.g., valid code being rejected or compiler exceptions). In contrast, this project targets IDE diagnostics, pairing snippet minimization with shallow project cloning that strips unused files and libraries for a clean, shareable repro. Together with formal approaches for code minimization (such as code slicing), you can also rely on the IDE functionality (e.g., on Find Usages for detecting unused declarations).
You're encouraged to reuse prior work where helpful.
Additionally, you may incorporate an LLM (e.g., JetBrains AI) as part of the pipeline. This is a novel direction for this problem space and hasn't been used by the mentioned tools. The LLM can effectively propose human-readable simplifications or stub replacements, while the Analysis API remains the ground truth, verifying that the diagnostic persists after each change.
Strong Java or Kotlin programming skills.
Working knowledge of language internals and tooling (parsing, static analysis, type systems, IDE tooling).
An experimental mindset. Willing to try, measure, and iterate to provide the best solution for the real-world problem.
A commitment to building a robust, maintainable solution rather than stopping at a rough prototype.
Optional pluses: familiarity with the IntelliJ Platform, the Kotlin Analysis API, or with build systems.