Skip to content

Populate CodeAction if its parent should also be modified. #26

@kenkangxgwe

Description

@kenkangxgwe

Currently, ApplyCodeAction deletes the very node that the CodeAction specifies, but this is not sound enough.
Given

Module[{a, b = 2 (* b is unused *)}, a]

The symbol b is marked, but in fact, we want to remove b = 2. So I think a code action can be populated up until it reaches the node that can actually fix the problem. Moreover, the trailing comment seems easy to be removed if we treat it as the same as the trailing comma, but it will still be convenient to provide an additional list of nodes that can be removed as well.

I know that CodeParser`CodeAction` is not ready yet, so I am just sharing the idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions