# Dart IntelliJ Plugin


[](https://github.com/flutter/dart-intellij-third-party/actions/workflows/presubmit.yaml)
[](https://github.com/flutter/dart-intellij-third-party/actions/workflows/integration_tests.yaml)
## Installing Dev Builds
To receive development builds of the Dart plugin in IntelliJ IDEA:
1. Open **Settings** (or **Preferences** on macOS) in IntelliJ IDEA.
2. Go to **Plugins**.
3. Click the ⚙️ (**Gear icon**) at the top of the Plugins panel and select **Manage Plugin Repositories...**.
4. Click **+** and add the dev channel repository URL:
```text
https://plugins.jetbrains.com/plugins/dev/6351
```
5. Click **OK**. The IDE will now check for and install updates from the `dev` channel.
## Development setup
1. Clone this repository with
```shell
git clone git@github.com:flutter/dart-intellij-third-party.git
```
2. Download the latest stable [IntelliJ Ultimate](https://www.jetbrains.com/idea/buy) or [IntelliJ Community](https://www.jetbrains.com/idea/download).
3. From the "Welcome to IntelliJ IDEA" dialog, select "Open" and then select `third_party` directory in this repository.
4. View > Tool Windows > Gradle, and click the button "Sync All Gradle Projects".
5. The Java source code should now be compiled. To launch an IDE with this plugin, execute the following on the command line (from the `third_party` directory):
```shell
./gradlew runIde
```
The commands below assume you are in the `third_party` directory. The repository root also has `gradlew` / `gradlew.bat` wrappers that forward to `third_party/gradlew`, so `./gradlew <task>` works from the root as well (path arguments are still resolved relative to `third_party`).
### Gradle tasks
This project is built with the [IntelliJ Platform Gradle Plugin](https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html)
To see all current and valid Gradle tasks execute
```shell
./gradlew tasks
```
A subset of the current output from `tasks` command:
```
----------------------------------------------------------
Tasks runnable from root project 'Dart'
------------------------------------------------------------
Build tasks
-----------
assemble - Assembles the outputs of this project.
build - Assembles and tests this project.
...
IDE tasks
---------
cleanIdea - Cleans IDEA project files (IML, IPR)
idea - Generates IDEA project files (IML, IPR, IWS)
openIdea - Opens the IDEA project
Intellij platform tasks
-----------------------
buildPlugin - Builds the plugin and prepares the ZIP archive for testing and deployment.
runIde - Runs the IDE instance using the currently selected IntelliJ Platform with the built plugin loaded.
verifyPlugin - Runs the IntelliJ Plugin Verifier CLI tool to check the binary compatibility with specified IDE builds.
...
```
### Tests
To run **all** tests execute
```shell
./gradlew test
```
However, in the project tests are split between the unit tests under
`third_party/src/test/java/com/jetbrains/lang/dart` and the Dart Analysis Server tests under
`third_party/src/test/java/com/jetbrains/dart/analysisServer`.
To run the **unit tests** on the command line run:
```shell
./gradlew test --tests "com.jetbrains.lang.dart.*"
```
To run the **Dart Analysis Server tests**, first set a `DART_HOME` (configured and set in
`.github/workflows/presubmit.yaml` and in the tests themselves), then on the command line run:
```shell
./gradlew test --tests "com.jetbrains.dart.analysisServer.*"
```
To get the same pinned Dart SDK that CI uses, run `../tool/provision_dart.sh` from the `third_party` directory. It downloads the SDK into `dart-sdk/` at the repository root (skipped if already present); then set `DART_HOME` to that directory. The pinned version is bumped weekly by `.github/workflows/update_dart.yaml`.
These test suites can be configured as Gradle run configurations for running and debugging the tests from the IDE.
On GitHub, the presubmit workflow (`.github/workflows/presubmit.yaml`) runs the unit tests (`com.jetbrains.lang.dart.*`). The integration tests workflow (`.github/workflows/integration_tests.yaml`) runs `com.jetbrains.dart.*`, which includes the Dart Analysis Server tests, against the provisioned SDK.
### IntelliJ Plugin Verifier
See `intellij-plugin-verifier`, https://github.com/JetBrains/intellij-plugin-verifier.
To run the verifier run:
```shell
./gradlew verifyPlugin
```
The plugin verification is run on GitHub presubmits, configured in `.github/workflows/presubmit.yaml`. Presubmit also runs `verifyPluginProjectConfiguration`, `verifyPluginSignature`, and `verifyPluginStructure`.
Known verifier issues are recorded per IDE branch in `third_party/tool/baseline/<branch>/verifier-baseline.txt`. Presubmit runs `third_party/tool/check_verifier_baselines.sh check`, which reports and fails on any issue not in the baseline. To refresh the baselines after an intended change, run `./third_party/tool/update_baselines.sh` (or `third_party\tool\update_baselines.bat` on Windows) from the repository root.
## Project and repository history
This repository was originally a copy of the [Dart Plugin for IntelliJ from JetBrains](https://github.com/JetBrains/intellij-plugins/tree/master/Dart) through the commit https://github.com/JetBrains/intellij-plugins/commit/c912b13b1dd8acccd6259dedc4063848a8f87b2b.
Before the move to this repository, the project had 4 working and active branches which were used to build different IntelliJ versions:
- `243` - 2024.3
- `251` - 2025.1
- `252` - 2025.2
- `master` - the current master for intellij-community, targeting the next version 2025.3
In its original location the project was built with Bazel; however, in github.com/flutter, the project is built using Gradle (see https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html).
## AI Coding Agent Skills
This repository comes with custom configuration and automation skills for AI coding agents (such as Gemini Code Assist / Antigravity).
These skills are located in the [.agents/skills/](.agents/skills/) directory. They are automatically discovered and loaded by agentic workflows when they analyze the workspace.
### Available Workspace Skills:
* **[Code Review](.agents/skills/code-review/SKILL.md):** Performs a pedantic, multi-perspective code review (covering logic, correctness, resource safety, design, and styleguide compliance) on your uncommitted changes.
* **[Dependabot PR Review](.agents/skills/dependabot-pr-review/SKILL.md):** Lists open Dependabot PRs in the Dart and Flutter IntelliJ plugins with their build status, then approves the ones you confirm and applies the `autosubmit` label. When Kokoro is the only failing build, offers to re-run it with the `kokoro:run` label.
* **[Implement Dart Language Feature](.agents/skills/implement-dart-language-feature/SKILL.md):** Guidelines for implementing and reviewing new Dart language features, parsing logic, and grammar modifications.
* **[Load Repository Context](.agents/skills/load-repo-context/SKILL.md):** Primes understanding of repository architecture by navigating hierarchical ABOUT.md manifests.
* **[Migrate DAS to LSP](.agents/skills/migrate-das-to-lsp/SKILL.md):** Guide for converting legacy Dart Analysis Server (DAS) feature implementations to JetBrains LSP in the Dart IntelliJ plugin.
* **[Monthly Release](.agents/skills/monthly-release/SKILL.md):** Step-by-step guide for preparing, validating, testing, and publishing monthly releases of the Dart IntelliJ plugin.
* **[Patch Copied LSP Sources](.agents/skills/patch-copied-lsp-sources/SKILL.md):** Automates copying and patching of JetBrains LSP sources.
* **[Port PR](.agents/skills/port-pr/SKILL.md):** Fetches a Pull Request from either the dart-intellij-third-party or flutter-intellij repository and conceptually ports its changes to the other repository.
* **[Root Cause Regression](.agents/skills/root-cause-regression/SKILL.md):** Investigates a GitHub issue reporting a regression, analyzes recent commits, and identifies possible culprits.
* **[Sync VM Service Drivers](.agents/skills/sync-vm-service-drivers/SKILL.md):** Advances the generated VM Service Java drivers one protocol version at a time with a user-reviewed, test-first workflow.
### How to use:
Tell your AI assistant to run the desired skill (e.g. by typing `/code-review` or asking *"Run the code-review skill on my changes"*). The agent will automatically find, load, and follow the instructions in the corresponding `SKILL.md` file.
### Repository tooling
Presubmit runs these checks from the repository root:
* `./tool/check_agent_skills.sh`: verifies that the skill list above matches the directories in `.agents/skills/`. Update this list when adding or removing a skill.
* `./tool/validate_skills.sh`: lints the skills with `skills_lint`.
* `./tool/check_ai_config.sh`: verifies that `.aiexclude` and `.gemini/config.yaml` `ignore_patterns` match and that every `.agents/rules/*.md` declares a `trigger:`.
## Contributing to this plugin
If you would like to contribute to the Dart plugin, see our [contribution guide](CONTRIBUTING.md).