Skip to content

Code actions "Move to file" and "Move to new file" are shown everywhere聽#56416

Closed

Description

  • open this file
  • select data
  • select light bulb
  • 馃悰 there is entries for "Move to file" and "Move to new file"
Screenshot 2023-10-25 at 08 13 20

Activity

  1. justschen commented on Oct 26, 2023

    @justschen
    Contributor

    It's unrelated to editor.codeActionWidget.includeNearbyQuickFixes, but this does happen in every file.

    imo, maybe the lightbulb shouldn't show for non-fix actions? if it's only move..., i can see how that can be annoying.

    vs like how we have this one to indicate quickfixable actions.
    Screenshot 2023-10-25 at 6 12 59鈥疨M

  2. jrieken commented on Oct 26, 2023

    @jrieken
    ContributorAuthor

    imo, maybe the lightbulb shouldn't show for non-fix actions? if it's only move..., i can see how that can be annoying.

    I wouldn't declare this as a generic light bulb issue, yet. Having refactoring sold by it does makes sense but it shouldn't be as spammy as it is today with 'Move...'. It seem they show unconditionally (like for loop counters or semicolons) and would benefit from some self-control, e.g only show when on a method, function, class etc ppp

  3. justschen commented on Oct 26, 2023

    @justschen
    Contributor

    Johannes Rieken (@jrieken) atm, it is just shown in every non-empty line in a method, class, function, etc. and in some files, that means the entire file and nearly every line.

    Could maybe play around with only having it to show up at the line of function/class/methoid declaration, but not in the code body? Not sure if Matt Bierner (@mjbvz) has any opinions on this.

  4. mjbvz commented on Nov 15, 2023

    @mjbvz
    Contributor

    Some ideas:

    • Only show the lightbulb (implicit code action) when on declarations
    • Maybe still keep showing these actions if refactorings are explicitly requested
    • In the refactoring label, show the name of what is going to be moved. Right now it makes is seem like the loop itself will get moved
  5. jrieken commented on Nov 16, 2023

    @jrieken
    ContributorAuthor

    Only show the lightbulb (implicit code action) when on declarations

    馃挴 on that - showing the code action further down is noise and lowers my trust in light bulb being helpful (and not ad-space)

  6. aiday-mar commented on Nov 23, 2023

    @aiday-mar
    Contributor

    HI Nathan Shively-Sanders (@sandersn), I would like to have a go at this PR. Could I have a pointer to place in the code where the change should be, or discuss this issue with one of your team members in a meeting? We are currently looking into displaying code actions in the light-bulb menu in VS Code on empty lines too, and currently we are seeing the Move to file and Move to new file actions appearing very often. I had initially prepared a PR to patch this issue on the VS Code side, but we think ideally this fix should come directly from TypeScript

  7. sandersn commented on Nov 27, 2023

    @sandersn
    Member

    Aiday Marlen Kyzy (@aiday-mar) I believe navya9singh and Andrew Branch (@andrewbranch) have worked the most on Move To File.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    VS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestone

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions