Skip to content

Correct typos #8324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 39 additions & 39 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Contributing to Flutter Plugin for IntelliJ
![GitHub contributors](https://img.shields.io/github/contributors/flutter/flutter-intellij.svg)

We gladly accept contributions via GitHub pull requests!
If you are new to codiing IntelliJ plugins,
here are a couple links to get started:
If you are new to coding IntelliJ plugins,
here are a couple of links to get started:

- [INTRODUCTION TO CREATING INTELLIJ IDEA PLUGINS](https://developerlife.com/2020/11/21/idea-plugin-example-intro/)
- [ADVANCED GUIDE TO CREATING INTELLIJ IDEA PLUGINS](https://developerlife.com/2021/03/13/ij-idea-plugin-advanced/)
Expand All @@ -43,13 +43,13 @@ name and contact info to the [AUTHORS](AUTHORS) file.
1. Install Flutter SDK from [Flutter SDK download](https://flutter.dev/docs/get-started/install) or
[GitHub](https://github.com/flutter/flutter) and set it up according to its instructions.
2. Verify installation from the command line:
- Connect an android device with USB debugging.
- Connect an Android device with USB debugging.
- `cd path/to/flutter/examples/hello_world`
- `flutter pub get`
- `flutter doctor`
- `flutter run`
3. Fork `https://github.com/flutter/flutter-intellij` into your own GitHub account.
If you already have a fork, and are now installing a development environment on a new machine,
If you already have a fork and are now installing a development environment on a new machine,
make sure you've updated your fork with the master branch
so that you don't use stale configuration options from long ago.
4. `git clone -c core.symlinks=true https://github.com/<your_name_here>/flutter-intellij`
Expand All @@ -59,13 +59,13 @@ name and contact info to the [AUTHORS](AUTHORS) file.

## Environment set-up

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

2. Set your `JAVA_HOME` directory in the configuration file for your shell environment.
- For example, on macOS, the following works:
Check what version of java you have:
Check what version of Java you have:
```shell
/usr/libexec/java_home -V
```
Expand All @@ -86,7 +86,7 @@ name and contact info to the [AUTHORS](AUTHORS) file.
```shell
which flutter
```
This should print out a path to the Flutter SDK such as:
This should print out a path to the Flutter SDK, such as:
```shell
home/path/to/flutter/bin/flutter
```
Expand All @@ -95,8 +95,8 @@ name and contact info to the [AUTHORS](AUTHORS) file.
export FLUTTER_SDK="$HOME/path/to/flutter"
```

4. Set your `DARK_SDK` path in the configuration file for your shell environment.
- In your shell configuration file (e.g. `.bashrc` or `.zshrc`), set your `DART_SDK` env variable to match the Dart SDK in your Flutter SDK. This should look like the `FLUTTER_SDK` path (added above) with `/bin/cache/dart-sdk` appened to the end.
4. Set your `DART_SDK` path in the configuration file for your shell environment.
- In your shell configuration file (e.g. `.bashrc` or `.zshrc`), set your `DART_SDK` env variable to match the Dart SDK in your Flutter SDK. This should look like the `FLUTTER_SDK` path (added above) with `/bin/cache/dart-sdk` appended to the end.
```shell
export DART_SDK="$HOME/path/to/flutter/bin/cache/dart-sdk"
```
Expand All @@ -108,7 +108,7 @@ name and contact info to the [AUTHORS](AUTHORS) file.
```

6. Update your current `PATH`.
- Either re-start your terminal or run `source ~/.zshrc` / `source ~/.bashrc` to add the new environment variables to your `PATH`.
- Either restart your terminal or run `source ~/.zshrc` / `source ~/.bashrc` to add the new environment variables to your `PATH`.

## IntelliJ set-up

Expand Down Expand Up @@ -138,7 +138,7 @@ name and contact info to the [AUTHORS](AUTHORS) file.
```
- **[Note]** If you want, you can manually change these properties to target different versions of IntelliJ. See `product-matrix.json` to find which configurations are supported.

3. Start the IntelliJ IDEA with the `flutter-intellij` project.
3. Start IntelliJ IDEA with the `flutter-intellij` project.
- If you see a popup with "Gradle build scripts found",
**confirm loading the Gradle project, and wait until syncing is done.**
- If you didn't see the popup at the first start, **delete & re-clone the repo** and try again.
Expand All @@ -158,7 +158,7 @@ name and contact info to the [AUTHORS](AUTHORS) file.

2. Add the IntelliJ JBR from disk:
- Select "Platform Settings > SDKs"
- Click the "+" sign at the top "Add New SDK (Alt+Insert)", then select "Add JDK from disk...".
- Click the "+" sign at the top, click "Add New SDK (Alt+Insert)", then select "Add JDK from disk...".
- Select your IntelliJ application (most likely under `Applications`) and from there, select the `Contents/jbr/Contents/Home` directory
- **[For macos]** You won't be able to select the `Contents` directory from Finder without right-clicking on the IntelliJ application, and selecting "Quick Look" from the dropdown that opens. From there, you can select the `Contents` directory.
- Change the name so that you can easily identify it, e.g. `IDEA JBR 21`.
Expand All @@ -170,11 +170,11 @@ name and contact info to the [AUTHORS](AUTHORS) file.

3. Add the IntelliJ Platform Plugin SDK
- Select "Platform Settings > SDKs"
- Click the "+" sign at the top "Add New SDK (Alt+Insert)", then select "Add IntelliJ Platform Plugin SDK...".
- Click the "+" sign at the top, click "Add New SDK (Alt+Insert)", then select "Add IntelliJ Platform Plugin SDK...".
- **[Note]** If you don't see this option, ensure you have the DevKit plugin installed.
- Select your IntelliJ application (most likely under `Applications`) and from there, select the `Contents` directory
- **[For macos]** You won't be able to select the `Contents` directory from Finder without right-clicking on the IntelliJ application, and selecting "Quick Look" from the dropdown that opens.
- Remember the generated name (probably `IntelliJ IDEA IU-231.8109.175`) or change to name to format like this.
- Remember the generated name (probably `IntelliJ IDEA IU-231.8109.175`) or change to name to a format like this.
- Change the **Internal Java Platform** to the JBR you added in step 2. (e.g. `IDEA JBR 21`).
- When you are done, your settings should look something like:
```
Expand All @@ -195,7 +195,7 @@ name and contact info to the [AUTHORS](AUTHORS) file.
- Select "Project Settings > Modules"
- Select the `flutter-intellij > flutter-idea` module
- Switch to the "Paths" window
- Select the **Inherit project compile output path** option then apply.
- Select the **Inherit project compile output path** option, then apply.

6. Change the modules SDK to the Project SDK
- Select "Project Settings > Modules"
Expand All @@ -205,7 +205,7 @@ name and contact info to the [AUTHORS](AUTHORS) file.

### Configure the Gradle settings

1. From IntelliJ, Open the "Settings" dialog (`IntelliJ IDEA | Settings`).
1. From IntelliJ, open the "Settings" dialog (`IntelliJ IDEA | Settings`).

2. Change the Gradle JVM to the Project SDK
- Select "Build, Execution, Deployment > Build Tools > Gradle"
Expand Down Expand Up @@ -234,22 +234,22 @@ name and contact info to the [AUTHORS](AUTHORS) file.

### Build and run the plugin

1. One-time Dart plugin install - first-time a new IDE is installed and run you will need to install the Dart plugin.
1. One-time Dart plugin install - first time a new IDE is installed and run, you will need to install the Dart plugin.
- Find `Plugins` (in "File | Settings | Plugins") and install the Dart plugin, then restart the IDE if needed.

2. [Optional] Add a key for JX Browser (see **Working with Embedded DevTools (JxBrowser)** below)
- **[Note]** This is only required if you are making changes to the embedded views.

3. Build the project using `Build` | `Build Project`.

4. Try running the plugin; select the `flutter-intellij [runIde]` run config then click the Debug icon.
4. Try running the plugin; select the `flutter-intellij [runIde]` run config, then click the Debug icon.
This should open the "runtime workbench", a new instance of IntelliJ IDEA with the plugin installed.

5. If the Flutter Plugin doesn't load (Dart code or files are unknown) see above "One-time Dart plugin install".
5. If the Flutter Plugin doesn't load (Dart code or files are unknown), see above "One-time Dart plugin install".

6. Verify installation of the Flutter plugin:
- Select `flutter-intellij [runIde]` in the Run Configuration drop-down list.
- Click Debug button (to the right of that drop-down).
- Click the Debug button (to the right of that drop-down).
- In the new IntelliJ process that spawns, open the `path/to/flutter/examples/hello_world` project.
- Choose `Edit Configurations...` in the Run Configuration drop-down list.
- Expand `Edit configuration templates...` and verify that Flutter is present.
Expand Down Expand Up @@ -281,19 +281,19 @@ since they can lead to various file-based issues during development.

## Provision Tool

This is not currently required. However, for debugging unit tests it may be handy; please ignore for now.
This is not currently required. However, for debugging unit tests, it may be handy; please ignore for now.

The Gradle build script currently assumes that some dependencies are present in the `artifacts` directory.
This project uses an External Tool in IntelliJ to ensure the dependencies are present.
It appears that external tools are not shareable.
To make one, open the "Run Configuration" dialog and select "Flutter Plugin".
Look at the "Before launch" panel. It probably displays an Unknown External Tool.
Double-click that, then click edit icon in the new panel (pencil).
Double-click that, then click the edit icon in the new panel (pencil).
Set the name to "Provision". Set the values:

- Program: /bin/bash
- Arguments: bin/plugin test -s
- Working directory: $ProjectFileDir$
- Program: `/bin/bash`
- Arguments: `bin/plugin test -s`
- Working directory: `$ProjectFileDir$`
- You can select that from a list by clicking the "+" symbol in the field

There is a screenshot of this dialog in `resources/intellij/Provision.png`.
Expand All @@ -312,18 +312,18 @@ The definition is in `resources/intellij/External Tools.xml`.
[Note: this may be out-of-date. It has not been verified recently.]

The repository contains two pre-defined test run configurations.
One is for "unit" tests; that is currently defined as tests
One is for "unit" tests; that is, currently defined as tests
that do not rely on the IntelliJ UI APIs.
The other is for "integration" tests - tests that do use the IntelliJ UI APIs.
The integration tests are larger, long-running tests that exercise app use cases.

In order to be able to debug a single test class or test method you need to do the following:
To be able to debug a single test class or test method, you need to do the following:

* Open the test source file in the editor. Navigate to `flutter-idea/testSrc/unit/...` to open it.
* Tests must run using Gradle, so be sure to open the source from the Gradle module.
* Find the test you want to run. Right-click the green triangle next to the test name and choose `Debug <test-name>`.

The test configuration can be tricky due to IntelliJ platform versioning.
The test configuration can be tricky due to the IntelliJ platform versioning.
The plugin tool (below) can be a more reliable way to run tests.

### Using the plugin tool on the command line
Expand All @@ -342,24 +342,24 @@ It is also possible to run tests directly with Gradle, which would allow passing
./gradlew test
```

If you wanted to run a subset of the tests you could do so this way.
If you wanted to run a subset of the tests, you could do so this way.
See the [Gradle docs](https://docs.gradle.org/current/userguide/java_testing.html)
for more info about testing.
*However*, you must have run the tests once using the plugin tool,
to ensure all the dependencies have been configured.

## Adding platform sources

Sometimes browsing the source code of IntelliJ is helpful for understanding platform details that aren't documented.
Sometimes browsing the source code of IntelliJ helps understand platform details that aren't documented.

- In order to have the platform sources handy, clone the IntelliJ IDEA Community Edition repo
- To have the platform sources handy, clone the IntelliJ IDEA Community Edition repo
(`git clone https://github.com/JetBrains/intellij-community`)
- Sync it to the same version of IntelliJ as given by `baseVersion` in gradle.properties (`git checkout 211.7628`).
It will be in "detached HEAD" mode.
- Open the Project Structure dialog (`File > Project Structure`). In the `IntelliJ IDEA Community Edition` sdk,
- Open the Project Structure dialog (`File > Project Structure`). In the `IntelliJ IDEA Community Edition` SDK,
head over to the `Sourcepaths` tab and add the path to `intellij-community`.
Accept all the root folders found by the IDE after scanning.
- Do the same for the intellij-plugins repo to get Dart plugin sources. Sync to the same version as before.
- Do the same for the `intellij-plugins` repo to get Dart plugin sources. Sync to the same version as before.

## Working with Android Studio

Expand All @@ -368,7 +368,7 @@ so it still needs the `flutter-intellij-community.iml` file.
Obviously, unit tests can only be run from the command line.

1. Initialize Android Studio sources.
2. Checkout Flutter plugin sources, tip of tree.
2. Checkout Flutter plugin sources, tip of the tree.
3. Follow the directions for setting up the Dart plugin sources in
`intellij-plugins/Dart/README.md` with these changes:
- you do not need to clone the intellij-community repo
Expand All @@ -379,10 +379,10 @@ Obviously, unit tests can only be run from the command line.
- intellij-plugins/Dart/Dart-community.iml (if there are lots of errors, see step 7)
- flutter-intellij/flutter-intellij-community.iml
6. Using the Project Structure editor, expand the tree to show `intellij > android > adt > ui`.
Select the `ui` module then add a module dependency from it to `flutter-intellij-community`.
Also add a dependency on the Dart module unless using step 7.
Select the `ui` module, then add a module dependency from it to `flutter-intellij-community`.
Also, add a dependency on the Dart module unless using step 7.
7. (Optional, when Dart sources are not usable.) Make sure the `flutter-intellij-community` module
has a dependency on a library named `Dart`. It should be pre-defined, but if it is out-of-date
has a dependency on a library named `Dart`. It should be pre-defined, but if it is out of date,
then adjust it to point to `flutter-intellij/third_party/lib/dart-plugin/xxx.yyyy/Dart.jar`.
Delete the Dart module from the Project Structure modules list.

Expand Down Expand Up @@ -415,9 +415,9 @@ By default, the DevTools version in IntelliJ will match the DevTools version shi
1. Make sure you have `dt` installed
- Follow instructions in the [DevTools set-up guide](https://github.com/flutter/devtools/blob/master/CONTRIBUTING.md#set-up-your-devtools-environment)
2. Set the registry key to your DevTools directory
- Go to Help > Find action > Registry > Find "flutter.local.devtools.dir" and set to your DevTools directory. (e.g. Users/user/dev/devtools)
- Go to Help > Find action > Registry > Find "flutter.local.devtools.dir" and set it to your DevTools directory. (e.g. Users/user/dev/devtools)
- Optional: If you want to pass additional arguments to `dt serve`, put these in the option "flutter.local.devtools.args"
3. Restart IntelliJ
4. Open Help > Show log in finder > Open idea.log
- Verify you see output like see output `"DevTools startup: <various messages that come from running dt serve>"`
5. To stop using local DevTools, go back to the registry key set in step 2 and remove it
5. To stop using local DevTools, go back to the registry key set in step 2 and remove it