You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stop eager presentation instantiation
<img width="1226" height="152" alt="image" src="https://github.com/user-attachments/assets/00d94eb7-d289-4555-a932-30a8b15fe150" />
From the inspection:
> Any of the constructors of AnAction with parameters instantiate the Presentation object. However, instantiating the Presentation object in constructor results in allocating resources, which may not be necessary. Instead of creating an instance of Presentation that stores text, description, or icon, it is more efficient to utilize no-argument constructors of AnAction and other base classes and follow the convention for setting the text, description, and icon in plugin.xml. The IDE will load text, description, and icon only when the action is actually displayed in the UI.
Confirmed that the label set in `plugin.xml` is sufficient:
<img width="1002" height="364" alt="image" src="https://github.com/user-attachments/assets/84b0586f-c4ab-4039-8881-5eb725b995ed" />
---
<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>
0 commit comments