Skip to content

Commit 8a76f22

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/upload-artifact-7
2 parents 0c19d38 + 70da7a0 commit 8a76f22

36 files changed

Lines changed: 749 additions & 364 deletions

.aiconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Gemini Code Assist Configuration
2+
version: 1.0
3+
project:
4+
context:
5+
instruction_files:
6+
- .gemini/styleguide.md
7+
8+
generation_rules:
9+
- "Strictly adhere to the IntelliJ Platform Threading Model: No I/O on the EDT."
10+
- "All generated AnAction classes must be stateless."
11+
- "Apply [MUST-FIX], [CONCERN], and [NIT] severity logic to any code suggestions that violate plugin SDK best practices or style guidelines."
12+
- "Use io.flutter.logging.PluginLogger for all logging; avoid System.out."
13+
- "Always include the standard Chromium Authors copyright header in new files."
14+
- "Adhere to the Zero-Formatting Policy: Do not comment on indentation, spacing, or brace placement."
15+
# Ensure local agents read styleguide files automatically.
16+
- "At the start of the session, read and adhere to the guidelines in all files listed in project.context.instruction_files."
17+
18+
languages:
19+
- java
20+
- kotlin
21+
- dart

.gemini/styleguide.md

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,66 @@
11
# Gemini Code Assist Flutter IntelliJ Plugin Style Guide
22

3-
You are an expert Java and Kotlin developer specializing in building on top of the IntelliJ Platform Plugin SDK. When reviewing pull requests for this repository,
3+
You are an expert Java and Kotlin developer specializing in building on top of the IntelliJ Platform Plugin SDK. When reviewing pull
4+
requests for this repository,
45
enforce standard modern Java/Kotlin coding conventions, but strictly police the architectural rules required for IntelliJ plugins.
56

67
## 1. AI Review Protocol (Noise Reduction)
8+
79
- **Zero-Formatting Policy:** Do NOT comment on indentation, spacing, or brace placement. We use `dart format` and IDE auto-formatters.
810
- **Categorize Severity:** Prefix every comment with a severity:
9-
- `[MUST-FIX]`: Security holes, threading violations, or logical bugs.
10-
- `[CONCERN]`: Maintainability issues, high duplication, or "clever" code that is hard to read.
11-
- `[NIT]`: Idiomatic improvements or minor naming suggestions.
11+
- `[MUST-FIX]`: Security holes, threading violations, or logical bugs.
12+
- `[CONCERN]`: Maintainability issues, high duplication, or "clever" code that is hard to read.
13+
- `[NIT]`: Idiomatic improvements or minor naming suggestions.
1214
- **Focus:** Prioritize logic, performance on the UI thread, and architectural consistency.
1315
- **No Empty Praise:** Do not leave "Looks good" or "Nice change" comments. If there are no issues, leave no comments.
16+
- **Copyright Headers:** Ensure all new files have a proper copyright header (e.g., `Copyright 2026 The Chromium Authors`). Flag any missing
17+
headers as `[MUST-FIX]`.
1418

1519
## 2. IntelliJ Platform Best Practices
20+
1621
- **Threading Model:** - NEVER perform heavy operations (I/O, complex PSI searches) on the **Event Dispatch Thread (EDT)**.
17-
- Wrap data access in `ReadAction.run()` or `ReadAction.compute()`.
18-
- Wrap modifications in `WriteAction.run()`.
19-
- In `AnAction`, ensure `getActionUpdateThread()` is implemented for 2022.3+ compatibility.
22+
- Wrap data access in `ReadAction.run()` or `ReadAction.compute()`.
23+
- Wrap modifications in `WriteAction.run()`.
24+
- In `AnAction`, ensure `getActionUpdateThread()` is implemented for 2022.3+ compatibility.
2025
- **Performance:**
21-
- In loops over PSI elements or Virtual Files, always call `ProgressManager.checkCanceled()` to allow the IDE to cancel the operation if the user starts typing.
26+
- In loops over PSI elements or Virtual Files, always call `ProgressManager.checkCanceled()` to allow the IDE to cancel the operation if
27+
the user starts typing.
2228
- **Resource Management & Memory Leaks:**
23-
- The IntelliJ platform uses the `Disposable` interface to manage the lifecycle of objects. Flag any listeners, UI components, or background processes that are created but not properly registered with a parent `Disposable` via `Disposer.register()`.
24-
- Flag the use of deprecated `ProjectComponent` or `ApplicationComponent`. Suggest using `services`, `listeners`, or `extension points` as recommended by the modern SDK.
29+
- The IntelliJ platform uses the `Disposable` interface to manage the lifecycle of objects. Flag any listeners, UI components, or
30+
background processes that are created but not properly registered with a parent `Disposable` via `Disposer.register()`.
31+
- Flag the use of deprecated `ProjectComponent` or `ApplicationComponent`. Suggest using `services`, `listeners`, or `extension points`
32+
as recommended by the modern SDK.
2533
- **Backward Compatibility:** Avoid using `@ApiStatus.Internal` or `@ApiStatus.ScheduledForRemoval` APIs unless strictly necessary.
2634
- **Logging:**
27-
- Reject any use of `System.out.println` or `System.err.println` for logging.
28-
- Enforce the use of the IntelliJ SDK's built-in logger: `com.intellij.openapi.diagnostic.Logger` or our own: `io.flutter.logging.PluginLogger.
35+
- Reject any use of `System.out.println` or `System.err.println` for logging in `src/` code (integration tests may use them for
36+
milestone logging).
37+
- Enforce the use of the IntelliJ SDK's built-in logger (`com.intellij.openapi.diagnostic.Logger`) or our own (
38+
`io.flutter.logging.PluginLogger`).
2939
- **Actions:**
30-
- Classes extending `AnAction` must be completely stateless. Flag any `AnAction` class that defines mutable instance variables (fields), as the platform instantiates a single instance of the action for the lifetime of the IDE.
31-
- Ensure `update(AnActionEvent e)` methods are fast and do not perform heavy calculations, as they are called frequently by the IDE to determine menu item visibility.
32-
- Ensure `actionPerformed(AnActionEvent e)` methods are instrumented w/ a call to analytics reporting like `Analytics.report(AnalyticsData.forAction(this, e))`.
40+
- Classes extending `AnAction` must be completely stateless. Flag any `AnAction` class that defines mutable instance variables (fields),
41+
as the platform instantiates a single instance of the action for the lifetime of the IDE.
42+
- Ensure `update(AnActionEvent e)` methods are fast and do not perform heavy calculations, as they are called frequently by the IDE to
43+
determine menu item visibility.
44+
- Ensure `actionPerformed(AnActionEvent e)` methods are instrumented w/ a call to analytics reporting like
45+
`Analytics.report(AnalyticsData.forAction(this, e))`.
3346

3447
## 3. Idiomatic Language Standards
48+
3549
### Dart
50+
3651
- Follow [Effective Dart](https://dart.dev/effective-dart).
3752
- **Naming:** `UpperCamelCase` for types, `lowerCamelCase` for members, `lowercase_with_underscores` for files.
3853
- **Concurrency:** Prefer `async/await` over raw `Future.then()`. Use `final` by default.
3954

4055
### Kotlin
56+
4157
- **Immutability:** Prefer `val` over `var`. Use `data class` for state-holding objects.
4258
- **Scope Functions:** Use `.let`, `.apply`, and `.also` correctly to reduce temporary variables.
4359
- **Null Safety:** NEVER use the double-bang `!!` operator. Use `?.`, `?:`, or `if (x != null)`.
4460
- **Naming:** Enforce standard Java/Kotlin naming conventions (camelCase for variables, PascalCase for classes).
4561

4662
### Java (Modern)
63+
4764
- Use **Switch Expressions** instead of multi-line `if/else` or old `switch` statements.
4865
- Use `java.util.Optional` for return types that may be empty; avoid returning `null`.
4966
- Enforce standard Java/Kotlin naming conventions (camelCase for variables, PascalCase for classes).
@@ -52,6 +69,9 @@ enforce standard modern Java/Kotlin coding conventions, but strictly police the
5269
- Avoid stray `TODO` or `FIXME` comments without justification.
5370

5471
## 4. Code Quality & Maintainability
72+
5573
- **Single Responsibility:** Methods should ideally be 10-20 lines. If a method exceeds 30 lines, suggest a refactor.
5674
- **DRY:** Identify blocks of code that are 90%+ identical to existing utility methods in this repo and flag them for duplication.
5775
- **Meaningful Naming:** Variables should describe their intent (e.g., `timeoutInMs` instead of `t`).
76+
- **Descriptive Pull Request:** Contributors should include the information recommended in the pull request template (In
77+
`.github/PULL_REQUEST_TEMPLATE.md`Ï)

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
1-
Thanks for your contribution! Please replace this text with a description of what this PR is changing or adding and why, list any relevant issues, and review the contribution guidelines below.
1+
Thanks for your contribution! Please replace this text with:
2+
3+
- a description of what this PR is changing and why
4+
- any relevant issues
5+
- a description of how to verify the change is working
6+
- screenshots/gif if relevant
27

38
---
49

10+
Review the contribution guidelines below:
11+
512
- [ ] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
13+
- [ ] I've included the required information in the description above.
14+
- [ ] My up-to-date information is in the `AUTHORS` file.
15+
- [ ] I've updated `CHANGELOG.md` if appropriate.
616

717
<details>
818
<summary>Contribution guidelines:</summary><br>
919

10-
- See our [contributor guide]([https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md) for general expectations for PRs.
20+
- See
21+
our [contributor guide](../CONTRIBUTING.md) and
22+
the [Flutter organization contributor guide]([https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md)
23+
for general expectations for PRs.
1124
- Larger or significant changes should be discussed in an issue before creating a PR.
12-
- Dart contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`.
13-
- Java and Kotlin contributions should strive to follow Java and Kotlin best practices ([discussion](https://github.com/flutter/flutter-intellij/issues/8098)).
25+
- Dart contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use
26+
`dart format`.
27+
- Java and Kotlin contributions should strive to follow Java and Kotlin best
28+
practices ([discussion](https://github.com/flutter/flutter-intellij/issues/8098)).
29+
1430
</details>

AUTHORS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ Eli Albert <crasowas@gmail.com>
2525
Mohamed El Sayed <devblooming@tutanota.com>
2626
Edwin Ludik <edwin.ludik@gmail.com>
2727
Japnit Singh <truejswalia@gmail.com>
28+
Dmitry Kandalov <dmitry.kandalov@gmail.com>
29+
Kazuya Chikamatsu <kazu.chika.shima@gmail.com>
30+
Dustin Feucht <code.nopjar@gmail.com>

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,28 @@
22

33
### Added
44

5+
- Option to specify the pub root module for Flutter Widget Previewer. (#8888)
6+
57
### Changed
68

79
### Removed
810

911
### Fixed
12+
- Silent failure when opening Flutter projects without `.idea` directory in IntelliJ IDEA, by removing `FlutterProjectOpenProcessor` and
13+
migrating configuration logic to `FlutterInitializer`. (#8903)
14+
15+
## 91.0.0
16+
17+
### Changed
18+
19+
- Gradle plugin version to re-enable running `./gradlew verifyPlugin` locally. (#8847)
20+
21+
### Fixed
22+
23+
- Gutter buttons not running tests with non-ASCII characters in their names. (#8838)
24+
- Freeze from JX Browser close. (#8864)
25+
- Crash in split debugger mode in IntelliJ 2025.3+. (#8878)
26+
- Passing additional arguments from the Flutter test template. (#8836)
1027

1128
## 90.0.0
1229

CLAUDE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Flutter IntelliJ Plugin — Claude Code Guide
2+
3+
@.gemini/styleguide.md
4+
5+
## Additional Rules
6+
7+
- No I/O or heavy computation on the EDT (IntelliJ Threading Model).
8+
- All `AnAction` subclasses must be stateless (no mutable instance fields).
9+
- Use `io.flutter.logging.PluginLogger` (or IntelliJ's `Logger`) for all logging; never `System.out`.
10+
- All new files must include the standard Chromium Authors copyright header.
11+
- Zero-Formatting Policy: do not comment on indentation, spacing, or brace placement.
12+
- Categorize code suggestions with `[MUST-FIX]`, `[CONCERN]`, or `[NIT]` severity prefixes.

CONTRIBUTING.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ name and contact info to the [AUTHORS](AUTHORS) file.
5858
## Environment set-up
5959

6060
1. Install the latest [Java Development Kit](https://www.java.com/en/download/).
61-
- The current Java Development Kit version is: **23**.
6261
- **[Googlers only]** Install Java from go/softwarecenter instead.
6362

6463
2. Set your `JAVA_HOME` directory in the configuration file for your shell environment.
@@ -233,6 +232,23 @@ name and contact info to the [AUTHORS](AUTHORS) file.
233232
- Expand `Edit configuration templates...` and verify that Flutter is present.
234233
- Click [+] and verify that Flutter is present.
235234
235+
### Running against custom target IDEs
236+
237+
To test or debug the plugin against a different IDE target (like IntelliJ IDEA Community or Ultimate) without changing the project's compilation target, you can use the custom `runTarget` Gradle task.
238+
239+
Run it from the command line specifying the target IDE and version:
240+
```bash
241+
./gradlew runTarget -Pide=IntelliJ -PideV=2025.1
242+
```
243+
244+
* **`-Pide`**: Valid values are `AndroidStudio` (default), `IntelliJ` (Community), and `Ultimate`.
245+
* **`-PideV`**: Any valid version string or build number for the selected IDE.
246+
247+
To see a full list of available options and usage examples, run the task without any parameters:
248+
```bash
249+
./gradlew runTarget
250+
```
251+
236252
## Provision Tool
237253
238254
This is not currently required. However, for debugging unit tests, it may be handy; please ignore for now.

build.gradle.kts

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ plugins {
4040
// https://plugins.gradle.org/plugin/org.jetbrains.intellij.platform
4141
// https://plugins.gradle.org/plugin/org.jetbrains.kotlin.jvm
4242
id("java") // Java support
43-
id("org.jetbrains.intellij.platform") version "2.10.5" // IntelliJ Platform Gradle Plugin
43+
id("org.jetbrains.intellij.platform") version "2.12.0" // IntelliJ Platform Gradle Plugin
4444
id("org.jetbrains.kotlin.jvm") version "2.2.0" // Kotlin support
4545
id("org.jetbrains.changelog") version "2.2.0" // Gradle Changelog Plugin
4646
id("org.jetbrains.kotlinx.kover") version "0.9.4"
@@ -389,12 +389,18 @@ tasks {
389389
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-faq.html#how-to-check-the-latest-available-eap-release
390390
tasks {
391391
printProductsReleases {
392-
channels = listOf(ProductRelease.Channel.EAP)
393-
types = listOf(IntelliJPlatformType.IntellijIdeaCommunity)
392+
channels = listOf(ProductRelease.Channel.RELEASE, ProductRelease.Channel.EAP)
393+
types = listOf(IntelliJPlatformType.IntellijIdeaCommunity, IntelliJPlatformType.IntellijIdeaUltimate)
394394
untilBuild = provider { null }
395395

396396
doLast {
397397
productsReleases.get().max()
398+
println()
399+
println("Mapping printProductsReleases output to ideV:")
400+
println(" - The prefix (e.g., IU-, IC-) maps to -Pide (Ultimate, IntelliJ).")
401+
println(" - The number part (e.g., 261.23567.71) maps to -PideV.")
402+
println(" - Example: IU-261.23567.71 -> -Pide=Ultimate -PideV=261.23567.71")
403+
println()
398404
}
399405
}
400406
prepareJarSearchableOptions {
@@ -415,6 +421,53 @@ tasks {
415421
}
416422
}
417423

424+
intellijPlatformTesting {
425+
runIde {
426+
register("runTarget") {
427+
val target = project.findProperty("ide") as? String
428+
val version = project.findProperty("ideV") as? String
429+
430+
val actualTarget = target ?: "AndroidStudio"
431+
type = when (actualTarget) {
432+
"IntelliJ" -> IntelliJPlatformType.IntellijIdeaCommunity
433+
"Ultimate" -> IntelliJPlatformType.IntellijIdeaUltimate
434+
else -> IntelliJPlatformType.AndroidStudio
435+
}
436+
this.version = version ?: ideaVersion
437+
}
438+
}
439+
}
440+
441+
tasks.named("runTarget") {
442+
val target = project.findProperty("ide") as? String
443+
val version = project.findProperty("ideV") as? String
444+
445+
doFirst {
446+
if (target == null && version == null) {
447+
println("============================================================")
448+
println("runTarget - Available Options")
449+
println("============================================================")
450+
println("Valid values for -Pide:")
451+
println(" - AndroidStudio (default)")
452+
println(" - IntelliJ (IntelliJ IDEA Community)")
453+
println(" - Ultimate (IntelliJ IDEA Ultimate)")
454+
println()
455+
println("Valid values for -PideV:")
456+
println(" - Any valid version string for the selected IDE.")
457+
println(" - Examples for IntelliJ/Ultimate: 2024.1, 2024.2, 2024.3, 2025.1")
458+
println(" - Run './gradlew printProductsReleases' to see the full list.")
459+
println()
460+
println("Examples:")
461+
println(" ./gradlew runTarget -Pide=IntelliJ -PideV=2025.1")
462+
println(" ./gradlew runTarget -Pide=Ultimate -PideV=2025.1")
463+
println("============================================================")
464+
println("Stopping execution. Please run with parameters to launch a specific IDE.")
465+
466+
throw org.gradle.api.tasks.StopExecutionException()
467+
}
468+
}
469+
}
470+
418471
// A task to print the classpath used for compiling an IntelliJ plugin
419472
// Run with `./gradlew printCompileClasspath --no-configuration-cache `
420473
tasks.register<Task>("printCompileClasspath") {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66

77
ideaVersion=2025.2.3.9
8-
dartPluginVersion= 503.0.0
8+
dartPluginVersion= 504.0.0
99
# Also update the versions for verify checks in tool/github.sh.
1010
sinceBuild=251
1111
untilBuild=261.*

resources/META-INF/plugin.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,6 @@
335335
<!-- See https://github.com/flutter/flutter-intellij/issues/8029 -->
336336
<projectService serviceImplementation="io.flutter.view.InspectorView" overrides="false"/>
337337

338-
<projectOpenProcessor id="flutter" implementation="io.flutter.project.FlutterProjectOpenProcessor" order="first"/>
339-
340338
<editorNotificationProvider implementation="io.flutter.editor.FlutterPubspecNotificationProvider"/>
341339
<editorNotificationProvider implementation="io.flutter.inspections.SdkConfigurationNotificationProvider"/>
342340
<editorNotificationProvider implementation="io.flutter.editor.NativeEditorNotificationProvider"/>

0 commit comments

Comments
 (0)