Skip to content
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

Missing quick fix for omit_obvious_property_types in Dart Analysis view in IntelliJ #57017

Open
denniskaselow opened this issue Nov 4, 2024 · 3 comments
Labels
area-intellij Tracking issues for the Dart IntelliJ plugin. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@denniskaselow
Copy link

denniskaselow commented Nov 4, 2024

This line triggers the omit_obvious_property_types lint:

final String foo = '';

When using right click in the Analysis View in IntelliJ, there is no quick fix shown:
image

Pressing Alt+Enter directly on the type annotation where the lint occurs shows a quick fix:
image

If it's declared as a local variable (omit_obvious_local_variable_types), the quick fix is shown in the Analysis View:
image

Additionally Alt+Enter has the yellow light bulb for quick fixes:
image

One obvious difference between both lints is that one hasFix, while the other needsEvaluation (if this matters):

LintCode.omit_obvious_local_variable_types:
status: hasFix
LintCode.omit_obvious_property_types:
status: needsEvaluation

Dart version: Dart SDK version: 3.7.0-81.0.dev (dev) (Tue Oct 29 17:06:42 2024 -0700) on "windows_x64"

@dart-github-bot
Copy link
Collaborator

Summary: The omit_obvious_property_types lint does not have a quick fix available in the IntelliJ Analysis View, even though the lint is triggered. The quick fix is available when using Alt+Enter directly on the type annotation or when the lint is applied to a local variable.

@dart-github-bot dart-github-bot added area-intellij Tracking issues for the Dart IntelliJ plugin. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Nov 4, 2024
@eernstg
Copy link
Member

eernstg commented Nov 4, 2024

@bwilkerson
Copy link
Member

The status in [error_fix_status.yaml](https://github.com/dart-lang/sdk/blob/5b6e6865b03f808d9e1e74e4638c997650294839/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml#L2199-L2202) doesn't actually control anything. It's there only as away for us to track which diagnostics could have a fix that don't.

It is, however, required to match reality by having a test that compares it to the table used to produce fixes for diagnostics. It was the absence of a mapping in this table that prevented the fix from being displayed.

Thanks @eernstg for the CL to add the mapping to the table (and fix the status file to be consistent).

@devoncarew devoncarew removed the triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-intellij Tracking issues for the Dart IntelliJ plugin. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

5 participants