You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Convert quotes quick-fix does not appear to interpolated strings #2727
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)
I'm unable to repro this, I have a "Convert to relative" fix when I set this up as you describe above:
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!
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!
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!
Perfect, thanks! I was able to reduce it to just this:
voidmain(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).
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
Activity
DanTup commentedon Aug 24, 2020
I'm unable to repro this, I have a "Convert to relative" fix when I set this up as you describe above:
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
.packagesand.dart_tool)? Thanks!bsutton commentedon Aug 25, 2020
I'm also seeing this problem.
bsutton commentedon Aug 26, 2020
I've also just noticed that the quick fix to convert a line from double to single quotes is also missing.
DanTup commentedon Aug 26, 2020
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.previewLspis enabled or not? Thanks!bsutton commentedon Aug 27, 2020
I just created a new project using Flutter: New Project.
The quick change for strings works for a new project.
DanTup commentedon Aug 27, 2020
If you copy your
analysis_options.yamlover 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!bsutton commentedon Sep 1, 2020
This project exhibits the problem with tip 'convert to single quotes' missing.
dscript.zip
DanTup commentedon Sep 1, 2020
Perfect, thanks! I was able to reduce it to just this:
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
printtoken, and therefore produces no fix).bsutton commentedon Sep 1, 2020
Yes, I concur that its just on interpolated strings.
DanTup commentedon Sep 1, 2020
I've got a potential fix at https://dart-review.googlesource.com/c/sdk/+/161171/.
[Analyzer] Fix convert_to_single_quotes fix for interpolated strings
DanTup commentedon Sep 22, 2020
Fixed by dart-lang/sdk@fb0729b.
[-]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[/+]