Skip to content

Migrate or remove all API usages that will be removed with time #7718

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

Open
jwren opened this issue Oct 16, 2024 · 5 comments
Open

Migrate or remove all API usages that will be removed with time #7718

jwren opened this issue Oct 16, 2024 · 5 comments
Assignees
Milestone

Comments

@jwren
Copy link
Member

jwren commented Oct 16, 2024

Many of the errors reported in the JetBrains marketplace, https://plugins.jetbrains.com/plugin/9212-flutter/edit/versions/stable/615584, are for deprecated issues which will be removed, these usages in the Flutter plugin need to be migrated or removed.

@jwren jwren added this to the M83 milestone Oct 16, 2024
@jwren jwren self-assigned this Oct 16, 2024
@jwren
Copy link
Member Author

jwren commented Nov 15, 2024

The pre-requisite for this was to migrate to Gradle IntelliJ platform 2.1.x to have the updated verifier which is done, this work will not be finished for this upcoming Milestone, bumping to the next one.

@jwren jwren modified the milestones: M83, M84 Nov 15, 2024
jwren added a commit to jwren/flutter-intellij that referenced this issue Dec 4, 2024
jwren added a commit that referenced this issue Dec 4, 2024
jwren added a commit that referenced this issue Dec 4, 2024
jwren added a commit to jwren/flutter-intellij that referenced this issue Dec 17, 2024
jwren added a commit to jwren/flutter-intellij that referenced this issue Dec 17, 2024
jwren added a commit that referenced this issue Jan 8, 2025
@jwren
Copy link
Member Author

jwren commented Apr 11, 2025

Latest report from the marketplace continues to show progress and opportunity: https://plugins.jetbrains.com/plugin/9212-flutter/edit/versions/stable/712464. Also related, the verifier is currently not working see #8034 for status.

jwren pushed a commit that referenced this issue Apr 17, 2025
Fixes: #8073

Should unblock landing of
#8070,
#8071 and
#8018.

See also: #7718



## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
pq added a commit that referenced this issue Apr 17, 2025
…rowseFolderListener (#8070)

Migrate from a flavor of `addBrowseFolderListener` that's slated for
removal.


![image](https://github.com/user-attachments/assets/ad2cb246-f17d-4b0f-87c4-7d274f4ffa03)

See: #7718

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
pq added a commit that referenced this issue Apr 17, 2025
…PI (#8071)

Another unsafe `addBrowseFolderListener` migration, as in
#8070.

See: #7718

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
pq added a commit that referenced this issue Apr 17, 2025
`AnActionEvent.createFromDataContext` is slated for removal.

**EDIT:** Hrmmm. Not sure how we're supposed to migrate if
`ActionUiKind` is unavailable.

(Will have to research.)

See: #7718.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
pq added a commit that referenced this issue Apr 17, 2025
Migrates from unsafe slated-for-removal `Notification` constructors.

See: #7718

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
pq added a commit that referenced this issue Apr 17, 2025
Migrate to safe `AnActionListener` APIs.

This migration has been attempted before but was reverted as possibly
causing a hot reload regression
(#6996).

I've confirmed that hot reload works (Mac OS Meerkat) but have preserved
the note in case anything odd happens.

See: #7718

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
@pq
Copy link
Contributor

pq commented Apr 28, 2025

@jwren, @helin24: working through these, there are some internal bits for which there are not (and I expect may never be) migration paths (for example PlatformUtils.getPlatformPrefix() and module.setModuleType(..)). For these cases I'm inclined to ignore the inspection and call out to an issue tracking "necessary internal dependencies". How does that sound to you all?

@jwren
Copy link
Member Author

jwren commented Apr 28, 2025

@pq -- If they are marked as APIs that will removed from the platform, then no we can't just ignore them unfortunately. In the case here of PlatformUtils.getPlatformPrefix(), this API is marked as internal (not for removal, see https://github.com/JetBrains/intellij-community/blob/master/platform/core-api/src/com/intellij/util/PlatformUtils.java#L69). We should create a new issue and link it here, as well other locations where internal APIs are being used, and then also in the verifier logic where we have VerifyPluginTask.FailureLevel.INTERNAL_API_USAGES commented out.

pq added a commit that referenced this issue Apr 28, 2025
This method is marked as unstable and slated for possible removal.


![image](https://github.com/user-attachments/assets/feb9c87a-0cc4-44b1-8b40-509b21c48143)

That said, this replacement doesn't totally preserve the current
semantics.

@helin24: is there any reason we don't want to prompt a call to the
application manager here?

Specifically, we'll now cause this to happen (if `ourInstance` is
`null`):

```java
(ProgressManager)ApplicationManager.getApplication().getService(ProgressManager.class);
```

See: ##7718


---

- [x] I’ve reviewed the contributor guide and applied the relevant
portions to this PR.

<details>
  <summary>Contribution guidelines:</summary><br>

- See our [contributor
guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview)
for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before
creating a PR.
- Dart contributions to our repos should follow the [Dart style
guide](https://dart.dev/guides/language/effective-dart) and use `dart
format`.
- Java and Kotlin contributions should strive to follow Java and Kotlin
best practices
([discussion](#8098)).
</details>
pq added a commit that referenced this issue Apr 28, 2025
The `com.intellij.openapi.vfs. CharsetToolkit` is marked unstable.


![image](https://github.com/user-attachments/assets/e5b65300-897d-4240-a31f-1c77474f731b)

Luckily there's a standard Java substitute (as of Java 7).

See: #7718

---

- [x] I’ve reviewed the contributor guide and applied the relevant
portions to this PR.

<details>
  <summary>Contribution guidelines:</summary><br>

- See our [contributor
guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview)
for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before
creating a PR.
- Dart contributions to our repos should follow the [Dart style
guide](https://dart.dev/guides/language/effective-dart) and use `dart
format`.
- Java and Kotlin contributions should strive to follow Java and Kotlin
best practices
([discussion](#8098)).
</details>
pq added a commit that referenced this issue Apr 28, 2025
…amed` (#8124)

Move to the stable `afterLibraryRenamed` API variant.


![image](https://github.com/user-attachments/assets/46f4971f-0955-49eb-9338-78faba823aec)

See: #7718

---

- [x] I’ve reviewed the contributor guide and applied the relevant
portions to this PR.

<details>
  <summary>Contribution guidelines:</summary><br>

- See our [contributor
guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview)
for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before
creating a PR.
- Dart contributions to our repos should follow the [Dart style
guide](https://dart.dev/guides/language/effective-dart) and use `dart
format`.
- Java and Kotlin contributions should strive to follow Java and Kotlin
best practices
([discussion](#8098)).
</details>
pq added a commit that referenced this issue May 2, 2025
…8145)

Removes `Welcome.CreateNewProject` which is slated for removal.


![image](https://github.com/user-attachments/assets/0f220bac-8e30-493c-8afc-7537b0810bf5)


Interestingly this code has been dead since
6350cf8#diff-677d60b823c040a662bc3a70f9be4541281838b806d79c129da0e1227bada185.

See: #7718

---

- [x] I’ve reviewed the contributor guide and applied the relevant
portions to this PR.

<details>
  <summary>Contribution guidelines:</summary><br>

- See our [contributor
guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview)
for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before
creating a PR.
- Dart contributions to our repos should follow the [Dart style
guide](https://dart.dev/guides/language/effective-dart) and use `dart
format`.
- Java and Kotlin contributions should strive to follow Java and Kotlin
best practices
([discussion](#8098)).
</details>
@pq pq self-assigned this May 14, 2025
pq added a commit that referenced this issue May 15, 2025
…8192)

Migrate off deprecated APIs:

* `getClientProperty`
* `ExecutionManager.getInstance(project).getContentManager()` (for run
content descriptors)
* `EdtInvocationManager.getInstance()` (for `EDT` querying)

See: #7718

---

- [x] I’ve reviewed the contributor guide and applied the relevant
portions to this PR.

<details>
  <summary>Contribution guidelines:</summary><br>

- See our [contributor
guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview)
for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before
creating a PR.
- Dart contributions to our repos should follow the [Dart style
guide](https://dart.dev/guides/language/effective-dart) and use `dart
format`.
- Java and Kotlin contributions should strive to follow Java and Kotlin
best practices
([discussion](#8098)).
</details>
pq added a commit that referenced this issue May 20, 2025
`StartupActivity` is marked as obsolete with `ProjectActivity`
identified as the path forward.

This introduces a `FlutterProjectActivity` that does some rudimentary
error handling as well.

See #7718 and
#8100

---

- [x] I’ve reviewed the contributor guide and applied the relevant
portions to this PR.

<details>
  <summary>Contribution guidelines:</summary><br>

- See our [contributor
guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview)
for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before
creating a PR.
- Dart contributions to our repos should follow the [Dart style
guide](https://dart.dev/guides/language/effective-dart) and use `dart
format`.
- Java and Kotlin contributions should strive to follow Java and Kotlin
best practices
([discussion](#8098)).
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants