Skip to content

Support suggested fixes #2551

@cgdecker

Description

@cgdecker

Along with supporting more specific node locations (#2550) it would be very useful to have the ability to suggest replacement code for nodes. This is something that can be done with Android Lint, but for KSP processors that need to do validation of user code and report errors it would be extremely valuable to not have to rely on an external tool when the processor itself has the information it needs to suggest a fix.

KSP doesn't model the whole syntax tree so I would't expect it to be able to do every kind of suggested fix one might want, but I believe there are still many things that could be done through KSP.

I have a use-case, for example, where I need to prevent use of specific annotations, but for each I could suggest a different annotation to replace it with. Right now I can report an error with a message that suggests the replacement, but that isn't something tools could provide a way of automatically applying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions