For instructions on installing the Dart or Flutter extensions, go here.
v2.20.0 2018-11-02
Return of Inspect Widget
The Flutter: Inspect Widget
feature that was added in v2.17.0 but disabled in v2.17.1 due to bugs is now re-enabled by default when using Flutter version v0.10.2 or later. This command allows you to tap on a widget on your device/emulator to highlight it and jump directly to the source code where it was constructed.
Lint Names in Problems View
VS Code now natively shows lint names and error codes in the Problems view so the dart.showLintNames
setting has been removed.
Quick-Fix for Ignoring Lints/Hints
A new setting dart.showIgnoreQuickFixes
(default: false
) has been added that will add quick-fixes for ignoring lints and hints to the lightbulb menu.
These fixes will also show up in the Problems View.
Don’t Format Specific Files/Folders
Since VS Code does not allow per-folder/file settings, it’s now possible to stop certain files/folders from being formatted with the dart.doNotFormat
setting. The setting is an array of string globs that are checked against the full file path.
"dart.doNotFormat": [
"**/*.g.dart",
"**/generated/**",
"**/Google/flutter/**",
]
Note: Until this VS Code issue is implemented, this will stop both format-on-save and explicit Format Document calls from formatting.
Collapsed Call Stacks
When running in VS Code v1.29 (due in the next few weeks) stack traces will collapse “non-debuggable” code (based on your dart.debugSdkLibraries
and dart.debugExternalLibraries
settings).
Preview: build_runner Tasks
If you enable the dart.previewBuildRunnerTasks
setting and your project references build_runner
in its pubspec.yaml
then new tasks will be registered with VS Code. You can find these by running the Tasks: Run Task
, Tasks: Run Build Task
, Tasks: Run Test Task commands in the palette. The tasks will appear as pub
or flutter
depending on the type of projects you have open.
Running the watch
task will keep build_runner
running in the background, re-building files as required when you save changes. If you wish to have the task run automatically when you start debugging you can add it as a preLaunchTask
in your debug configuration.
Preview: toString() Calls in Debug Views
It’s now possible to force the debugger to call toString()
on classes when displaying them in debug views (this includes the Variables pane, the Watch pane, tooltips and inline debug views) with the dart.previewToStringInDebugViews
setting. This feature is experimental and may have a performance impact.
Before
After
Other Improvements
- Flutter projects in immediate subfolders of the workspace folder are now detected and will force the editor into Flutter mode.
- Formatting of text in progress notifications shown when Flutter is downloading SDKs/packages has been improved.
- Tooltips will no longer show dartdoc directives like
{@tool xxx}
. - Completing function names on an
import
/export
line will no longer try to insert argument placeholders as if you were calling the function. - Code completion will no longer pop open when typing colons in case statements.
- Code completion will no longer pop open when typing spaces outside of argument lists.
- Code completion for method/function calls with no argument placeholders will no longer get stuck in “snippet mode” causing further completions not to work until you press
<escape>
. - CodeLens links for running tests will no longer appear inside test files for projects that do not support being run with
pub run test
(for example the Dart SDK repository). - The “Create File” refactor no longer displays an error when invoked.
- Setting the debugger to break on
All Exceptions
will no longer pause inside threads running framework snapshots (such as duringpackage:test
startup code). - Debug sessions should no longer remain active until the Stop button is clicked when Dart script fails to compile.
- Terminating commands like
pub get
repeatedly should no longer result in orphaned progress notification messages. - PubCache and AppData folders are now excluded from analysis should you open your entire user directory in VS Code.
- The prompt offering to run
pub get
when the.packages
file is missing/out-of-date will no longer appear for Fuchsia projects. - The
dart.runPubGetOnPubspecChanges
setting now defaults tofalse
for Fuchsia projects. - The path
topaz/tools/prebuilt-dart-sdk/${platform}
has been added to the top of Dart SDK search paths for Fuchsia projects.
Note: This version requires VS Code v1.28 (up from v1.27).
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!