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
VSCode may cause bad char after format code! #45707
Hi @ashamp
could you please provide your flutter doctor -v?
If you print the bad char do you get the correct output?
Thank you
flutter doctor -v
[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.14.4 18E226, locale zh-Hans-CN)
• Flutter version 1.9.1+hotfix.6 at /Users/macbook/flutter
• Framework revision 68587a0 (3 months ago), 2019-09-13 19:46:58 -0700
• Engine revision b863200
• Dart version 2.5.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at /Users/macbook/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.1, Build version 11A1027
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 41.1.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.40.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.6.0
@ashamp am I understanding correctly that when you're running "Format Code" in VS Code, it is messing up the characters directly in the editor? (eg. it's not a Flutter bug, but VS Code or the VS Code extension?).
I tried here but have been unable to reproduce it. Does it occur in a small isolated .dart file (without Flutter)?
If so, could you paste some specific characters that trigger the issue for you and confirm which file encoding is shown in the VS Code status bar?
Can you also try running the Dart: Capture Logs command from the VS Code command palette (you can leave everything ticked) and then format the document (causing the bug), and then click Cancel on the logging notification to get a log file (note: this log may contain some of the contents of your source files - please check there is nothing sensitive before sharing).
@ashamp am I understanding correctly that when you're running "Format Code" in VS Code, it is messing up the characters directly in the editor? (eg. it's not a Flutter bug, but VS Code or the VS Code extension?).
I use shift+option+F code format before commit code to git server,than it is messing up the characters directly in the editor
I tried here but have been unable to reproduce it. Does it occur in a small isolated .dart file (without Flutter)?
not always occur,I have not find the regularity too.
If so, could you paste some specific characters that trigger the issue for you and confirm which file encoding is shown in the VS Code status bar?
when I have this bug occur next time ,I will try to save the file so it can be recur this bug.the encoding is UTF-8,the file is created by vscode.
Can you also try running the Dart: Capture Logs command from the VS Code command palette (you can leave everything ticked) and then format the document (causing the bug), and then click Cancel on the logging notification to get a log file (note: this log may contain some of the contents of your source files - please check there is nothing sensitive before sharing).
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
ashamp commentedon Nov 27, 2019
this is a very serious bug
ashamp commentedon Nov 27, 2019
iapicca commentedon Nov 28, 2019
Hi @ashamp
could you please provide your
flutter doctor -v?If you print the bad char do you get the correct output?
Thank you
ashamp commentedon Nov 28, 2019
flutter doctor -v
[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.14.4 18E226, locale zh-Hans-CN)
• Flutter version 1.9.1+hotfix.6 at /Users/macbook/flutter
• Framework revision 68587a0 (3 months ago), 2019-09-13 19:46:58 -0700
• Engine revision b863200
• Dart version 2.5.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at /Users/macbook/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.1, Build version 11A1027
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 41.1.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.40.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.6.0
[✓] Connected device (1 available)
• iPhone 11 • 37700F44-81F6-408B-AA15-9D8E114DA4E4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-1 (simulator)
• No issues found!
ashamp commentedon Nov 28, 2019
I take a screen shot show a toast .the message means "please enter 6 digit mobile verify code".

zanderso commentedon Dec 2, 2019
/cc @DanTup
DanTup commentedon Dec 2, 2019
@ashamp am I understanding correctly that when you're running "Format Code" in VS Code, it is messing up the characters directly in the editor? (eg. it's not a Flutter bug, but VS Code or the VS Code extension?).
I tried here but have been unable to reproduce it. Does it occur in a small isolated
.dartfile (without Flutter)?If so, could you paste some specific characters that trigger the issue for you and confirm which file encoding is shown in the VS Code status bar?
Can you also try running the Dart: Capture Logs command from the VS Code command palette (you can leave everything ticked) and then format the document (causing the bug), and then click Cancel on the logging notification to get a log file (note: this log may contain some of the contents of your source files - please check there is nothing sensitive before sharing).
Thanks!
ashamp commentedon Dec 3, 2019
I use shift+option+F code format before commit code to git server,than it is messing up the characters directly in the editor
not always occur,I have not find the regularity too.
when I have this bug occur next time ,I will try to save the file so it can be recur this bug.the encoding is UTF-8,the file is created by vscode.
ok,next time I will try this.
Thanks!
DanTup commentedon Dec 3, 2019
Ok great. Let's move this to the Dart-Code repository since I don't think it's a Flutter bug.
/move Dart-Code/Dart-Code
github-actions commentedon Aug 25, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.