Skip to content

Convert quotes quick-fix does not appear to interpolated strings #2727

Closed

Description

@johngithubby

The only action offered is "ignore lint 'prefer_relative_imports' for this line"
My analysis_options.yaml content:
include: package:effective_dart/analysis_options.yaml

[✓] Flutter (Channel stable, 1.20.1, on Mac OS X 10.15.6 19G2021, locale en-CA)
[✓] VS Code (version 1.48.0)

Activity

  1. DanTup commented on Aug 24, 2020

    @DanTup
    Member

    I'm unable to repro this, I have a "Convert to relative" fix when I set this up as you describe above:

    Screenshot 2020-08-24 at 10 54 34

    Could you try to reproduce this with a new project created with Flutter: New Project and if it repros, attach a zip of the whole folder (including the hidden items like .packages and .dart_tool)? Thanks!

  2. added
    awaiting infoRequires more information from the customer to progress
    on Aug 24, 2020
  3. bsutton commented on Aug 25, 2020

    @bsutton

    I'm also seeing this problem.

  4. bsutton commented on Aug 26, 2020

    @bsutton

    I've also just noticed that the quick fix to convert a line from double to single quotes is also missing.

  5. DanTup commented on Aug 26, 2020

    @DanTup
    Member

    Could you try to reproduce this with a new project created with Flutter: New Project and if it repros, attach a zip of the whole folder (including the hidden items like .packages and .dart_tool)?

    Also - could you confirm your SDK version + whether dart.previewLsp is enabled or not? Thanks!

  6. bsutton commented on Aug 27, 2020

    @bsutton

    I just created a new project using Flutter: New Project.

    The quick change for strings works for a new project.

  7. DanTup commented on Aug 27, 2020

    @DanTup
    Member

    If you copy your analysis_options.yaml over to the new project, does that break it? If not, are you able to try trimming down the project where this happens to something you can share? Thanks!

  8. bsutton commented on Sep 1, 2020

    @bsutton

    This project exhibits the problem with tip 'convert to single quotes' missing.
    dscript.zip

  9. DanTup commented on Sep 1, 2020

    @DanTup
    Member

    Perfect, thanks! I was able to reduce it to just this:

    void main(List<String> args) {
      var server = "foo";
    
      print("Using: $server");
    }

    The fix is appearing on the first string, but missing on the interpolated string. There are tests that seem to do exactly the same thing so I'm trying to figure out what's different (in this case, the fix producer is ending up with the print token, and therefore produces no fix).

  10. added
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    and removed
    awaiting infoRequires more information from the customer to progress
    on Sep 1, 2020
  11. added this to the v3.15.0 milestone on Sep 1, 2020
  12. bsutton commented on Sep 1, 2020

    @bsutton

    Yes, I concur that its just on interpolated strings.

  13. DanTup commented on Sep 1, 2020

    @DanTup
    Member
  14. DanTup commented on Sep 22, 2020

    @DanTup
    Member
  15. changed the title [-]Quick fix does not offer anymore a fix for "Prefer relative imports for files in `lib/`." problems[/-] [+]Convert quotes quick-fix does not appear to interpolated strings[/+] on Sep 24, 2020
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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions