For instructions on installing the Dart or Flutter extensions, go here.
v3.10.2 2020-05-16
- #2464 Debugging apps using recent bleeding-edge builds of the Dart/Flutter SDK will no longer fail with
Request must contain a "jsonrpc" key
.
v3.10.1 2020-05-03
- #2413
Ctrl
(/Cmd
)+Shift
+F5
is no longer bound to Dart: Rerun Last Debug Session when already in a debug session, which prevented using the default Restart Debugging shortcut.
v3.10.0 2020-05-01
Main Function CodeLens
#2356/#2359/#2373 CodeLens links are now available on main()
methods for both applications and test scripts. This allows running the current file even if the current launch configuration specifies another script. These links can be toggled using the dart.showMainCodeLens
setting.
The template
field in a launch config (see below for an example) has been extended to support templating these CodeLens.
run-test
applies totest()
andgroup()
CodeLens, runs without debuggingdebug-test
applies totest()
andgroup()
CodeLens, runs with debuggingrun-test-file
applies tomain()
CodeLens in test files, runs without debuggingdebug-test-file
applies tomain()
CodeLens in test files, runs with debuggingrun-file
applies tomain()
CodeLens in non-test files, runs without debuggingdebug-file
applies tomain()
CodeLens in non-test files, runs with debugging
Run Tests on Device
#2363/#2374: A new launch config flag runTestsOnDevice
has been added that allows you to create launch configurations that will run tests with flutter run
on the select device instead of using flutter test
.
Using the two features above together, you can add CodeLens links to easily run test scripts on a device:
{
"version": "0.2.0",
"configurations": [
{
"name": "Flutter App",
"request": "launch",
"type": "dart"
},
{
"name": "Debug Tests on Device",
"request": "launch",
"type": "dart",
"runTestsOnDevice": true,
// This adds this config to CodeLens for test files
"template": "debug-test-file"
}
]
}
Pub: List Outdated Packages
#2322/#2350: A new Dart: List Outdated Packages command has been added that runs pub outdated
. It’s also available on the context menu and editor toolbar for the pubspec.yaml
file.
This command will only show up when using >= v2.8 of the Dart SDK.
Custom Emulators
#1553/#2360/#2319: It’s now possible to add third party emulators that don’t show up in flutter emulators
to the device selector using the dart.flutterCustomEmulators
setting. The emulator must still show up in flutter devices
once it’s been launched for it to be used to launch an app:
"dart.flutterCustomEmulators": [
{
"id": "my-emu",
"name": "My Emulator",
"executable": "/path/to/emulator",
"args": ["--launch"]
}
]
This setting also allows the command/args used to launch existing Flutter emulators to be overridden by using the same ID. For example, to force an existing Android emulator with the ID Pixel_2_XL_API_29
to run with -gpu host
you can override its command/args:
{
"id": "Pixel_2_XL_API_29",
"name": "Pixel 2",
"executable": "/Users/danny/Library/Android/sdk/emulator/emulator",
"args": ["-avd", "Pixel_2_XL_API_29", "-gpu", "host"]
}
Editor
- #1991: Holding
<shift>
when accepting code completions will now always insert completion text (rather than replacing text immediately to the right of the cursor). Which mode is default can be controlled by setting theeditor.suggest.insertMode
for[dart]
in your user settings. - #2387: Errors and lints will now have clickable error codes (where available) to open a web page containing more information about the error/lint.
- #2169: Key-binding is now available for both fixes and refactors (see refactorings and code fixes, though note that all IDs may not work unless you’re using a very recent SDK version).
- #956: Closing Labels will now appear/disappear more reliably when enabling/disabling without restarting the editor.
- #2323: Symbols are no longer doubled in the workspace symbol list if
dart.additionalAnalyzerFileExtensions
includes.dart
or duplicates. - #2378: The Dart: Sort Members command now works when the LSP preview is enabled.
Debugger
- #2146:
Maps
with complex keys (such asDateTime
s) are now shown correctly in debug views like Watch and Variables. - #1990: The debugger
Copy value
action no longer adds"
around string values. - #1246: Debug views will now automatically call
toString()
on complex types. This can be controlled with thedart.evaluateToStringInDebugViews
setting. - #1021: The watch window will now show “not available” instead of an error message for variables that are not available at the current location.
- #2389: Clicking the debugger Stop button too soon after starting a Flutter debug session should no longer result in the app continuing to build and launch. However, there may be a short delay before the process terminates.
- #2403: Evaluating invalid expressions in the Debug Console will now show more specific error messages than “Expression compilation error”.
- #2404: Trailing semicolons will now be ignored when evaluating expressions to avoid unnecessary expression compilation errors.
- #2361: A warning will now be shown when launching an app if the casing of the
cwd
/program
fields do not match the casing on the underlying file system.
Testing
- #2380: Clicking Stop when paused in a test will now show a more obvious “Waiting for test to complete” notification.
- #2385: Clicking Stop when paused in a test will now automatically disable breakpoints and resume the test to allow it to complete and the session to end cleanly.
- #2362:
test()
s andgroup()
s with variables in the name are now runnable from CodeLens links with some caveats. - #2349: Running tests from the test tree and with the Dart: Run Test at Cursor command is now possible even if another debug session is running.
- #2351: The
flutter_test
package is no longer incorrectly marked as user-code so will not be debuggable when in Debug my code mode. - #2343: Running tests in the Dart SDK repo now (again) uses the VM directly.
- #2335: Running tests in a folder named
test
for a non-web project will no longer show a spurious error about not being supported.
Commands
- #2336: The Flutter: Run Flutter Doctor command no longer writes to an output window that is hidden by default.
- #2377: The Dart: Run all Tests command now works when your projects are in sub-folders of the open workspace.
- #2285/#2369: BootBlock contributed a new Dart: Rerun Last Test Session command which works like Dart: Rerun Last Debug Session but only considering recent test debug sessions.
Remoting Support
- #2376: Joining a Live Share session will no longer show a warning about editing loose Dart files.
- #2092/#2353: Flutter web debugging works when in a VS Code remoting session via the Dart Debug extension. This requires >= v1.18.0-5.0 of the Flutter SDK.
Other
- #2310: Invalid log paths (eg. copied from other machines) no longer result in activation failures with cryptic error messages.
Upstream Issues
Some feature requests and fixes require new features and fixes in upstream projects like VS Code and LSP which use counts of 👍s on those issues to help gauge demand. The Dart-Code website now lists some of the most significant upstream issues with a description of the feature/fix they would enable. Please consider reviewing this list and adding your 👍 to any GitHub issues relevant to features you’d like to see!