Skip to content

Visually distinguish fixes from non-fixes in lightbulb menu #132109

Closed

Description

@DanTup

When invoking the lightbulb menu on an error, the menu can include a mix of both fixes and non-fixes (eg. refactors) mixed together:

Screenshot 2021-09-02 at 10 21 36

It would be good if there was some visual separation or indication of which of these are fixes for the diagnostic and which are not. For example in Android Studio I see the fixes have lightbulbs and non-fixes have pencil/edit icons:

Screenshot 2021-09-02 at 10 25 09

Activity

  1. added
    editor-code-actions
    on Sep 2, 2021
  2. added
    feature-request
    on Sep 15, 2021
  3. added this to the Backlog milestone on Sep 15, 2021
  4. lgrammel commented on Aug 18, 2022

    @lgrammel

    Hey I just tried out the new menu in insiders and it looks great!

    I was wondering if you would consider adding 2 code action classes that are I think quite common:

    • refactor.inline (Inline)
    • refactor.move (Move)

    This would be super valuable for the extension that I'm developing (P42 JavaScript Assistant), but I think also for other extensions. Afaik the TS language server also has refactor.move actions for example.

  5. justschen commented on Aug 19, 2022

    @justschen
    Collaborator

    Lars Grammel (@lgrammel) Do you think you can provide examples of inline and move options and what those labels say?

    ATM, I know there is a Move to new file code action, and I just have it lumped under More Actions..., but if inline and move are sufficiently different, I'd like to provide them with their own codicons as well!

  6. lgrammel commented on Aug 19, 2022

    @lgrammel

    Justin Chen (@justschen) Here are some examples from "Refactoring, 2nd Edition" (Fowler) that could be relevant for language services from different languages:

    Inline:

    • Inline Class
    • Inline Function
    • Inline Variable

    Move:

    • Move Field
    • Move Function
    • Move Statement into Function
    • Move Statements to Callers

    I would also consider "Pull Up / Push Down" refactorings to be "move" refactorings, e.g. "Pull Up Field".

    P42 has several inline refactorings:

    • Inline variable
    • Inline return
    • Inline into template

    and many move refactorings, e.g.

    • Move statement
    • Move field initialization into constructor
    • Move switch case clause
    • Move default value into parameter
  7. added
    verification-needed
    on Aug 23, 2022
  8. locked and limited conversation to collaborators on Oct 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

editor-code-actionsfeature-requestverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions