Skip to content

Missing quickfix "update import" when hide is used in import #30503

Closed

Description

@zoechi

image

when I comment out hide user

image

I get the "update import" option, but I think I should also get it when hide User is there.

Activity

  1. added
    devexp-serverIssues related to some aspect of the analysis server
    P2A bug or feature request we're likely to work on
    type-enhancementA request for a change that isn't a bug
    on Aug 25, 2017
  2. bwilkerson commented on Jan 28, 2018

    @bwilkerson
    Member

    Agreed. We need to update FixProcessor._addFix_importLibrary_withElement to understand hide clauses.

  3. asashour commented on Sep 10, 2021

    @asashour
    Contributor

    Another question, what happens when the user tries to expose the 'hidden' function, e.g.

    import 'dart:math' hide max show min;
    
    void f() {
      max(1, 2);
    }

    Should we say: Update library import, or Unhide 'max'?


    The requester test case:

    import 'dart:math' hide atan show min;
    
    void f() {
      max(1, 2);
    }

    should have 'Update library import' to add max, instead of 'Import library'

  4. bwilkerson commented on Sep 23, 2021

    @bwilkerson
    Member

    The labels for a fix (or assist) should describe what it's going to do. We could say "Update import of ''", or we could be more specific about how it's going to be updated and say something like "Show '' from '' or "Unhide '' from ''" depending on how the import will be updated.

    For something like

    import 'dart:math' hide max show min;
    
    void f() {
      max(1, 2);
    }
    

    We actually need to do both: remove the hide clause and add max to the show clause. (I suspect that having both a hide and show clause is rare though, so I'm not sure it's worth having a third message for it.)

  5. FMorschel commented on Aug 30, 2024

    @FMorschel
    Contributor

    We actually need to do both: remove the hide clause and add max to the show clause. (I suspect that having both a hide and show clause is rare though, so I'm not sure it's worth having a third message for it.)

    In this case the "update" would be fine I think.

    Just to point out: some work related to show is being worked on Dart-Code/Dart-Code#5238.

  6. FMorschel commented on Oct 18, 2024

    @FMorschel
    Contributor

    I just would like to point out that there is an issue for warning when you have either two combinations of show/hide since you only need one to achieve any hiding goal

    You never need more than one show or one hide combinator to achieve any hiding-goal.

    From @lrhn's comment on #56879

  7. FMorschel commented on Oct 19, 2024

    @FMorschel
    Contributor
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

    P2A bug or feature request we're likely to work ondevexp-quick-fixIssues with analysis server (quick) fixesdevexp-serverIssues related to some aspect of the analysis serverlegacy-area-analyzerUse area-devexp instead.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions