Skip to content

Fix priorities are ad-hoc and should be made more regular #60879

Open
@bwilkerson

Description

@bwilkerson

The analysis server defines constants representing fix kinds. Those constants have a priority associated with them, represented as an integer. There are also constants representing those priorities, but those are published and we don't want to add constants specific to the server's fixes.

As a result, there are now 41 fix kinds whose priority is something like DartFixKindPriority.standard + 6. This makes it difficult to know what the rationale was for using a value other than standard or what value to choose for the next fix.

We should consider defining a server-specific set of priority constants that provides more consistency, and/or defining a set of 'adjustments' that can be consistently applied.

As an example of the latter, we now offer to create declarations of undefined names whether or not the name conforms to the standard naming convention. We have set the priority of convention-matching names higher than the non-convention-matching names and those adjustments could be represented as constants so that the same adjustments are applied uniformly across all declaration kinds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.type-code-healthInternal changes to our tools and workflows to make them cleaner, simpler, or more maintainable

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions