VS Code extensions v3.11 - Update imports on rename, global expression evaluation, improved CodeLens links

673 views
Skip to first unread message

Danny Tuppeny

unread,
May 29, 2020, 1:28:28 PM5/29/20
to Flutter Dev

Hey all,

v3.11.0 of the Dart/Flutter extensions for VS Code are live. Release notes are below (and online).

Preview: Update Imports on Rename

  • #548/#1740: A new setting (dart.previewUpdateImportsOnRename) has been added to enable automatically updating import statements when files are moved/renamed.
image.gif

This feature currently only works for files (not folders) and only a single file at a time (please add thumbs up to this VS Code issue!).

Improved Custom CodeLens for Tests and Main Functions

Improvements have been made to custom CodeLens for launch configurations. The existing template field on launch configurations has been deprecated and replaced with a new codeLens field.

  • #2459/#2466: A single launch configuration can now contribute multiple CodeLens links using codeLens.for.
  • #2458: A launch configuration can now specify that CodeLens links should only be shown within a sub-folder using codeLens.path.

For example, to add CodeLens for a launch config that sets a RELEASE_MODE=true environment variable to tests in test/integration_tests:

{
	"name": "Current File (release mode)",
	"type": "dart",
	"request": "launch",
	"codeLens": {
		// Types of CodeLens to inject
		"for": [ "run-test", "run-test-file", "debug-test", "debug-test-file" ],
		// Restrict to certain folders
		"path": "test/integration_tests",
		// Text for CodeLens link (${debugType} will be replaced with "run" or "debug")
		"title": "${debugType} (release)"
	},
	"env": { "RELEASE_MODE": true }
}

This will insert additional CodeLens links into tests, groups and main functions:

image.png

Global Expression Evaluation

  • #906/#1062: Expression evaluation in the Debug Console now works when not paused at a breakpoint/exception.
image.png

Evaluation is not currently scoped to the file/class you have open in the editor.

Commands

  • #2436/#2437: DevTools and other pub package updates are now correctly detected if they only vary by build metadata (+xyz), as described in Pub’s versioning scheme.
  • #2430/#2432: If DevTools fails to launch, the error notification now includes a button to try re-activating the package.
  • #2414/#2418pub and flutter commands will no longer show .bat suffixes in the output window on Windows.

Debugger

  • #2428/#2469: When setting breakpoints in locations that will not be hit (for example in the Dart SDK when dart.debugSdkLibraries is set to false) a warning will be shown offering to change debug settings.
  • #2424/#2467: It’s now possible to attach to processes using a --write-service-info file. This allows running arbitrary commands to spawn Dart processes that Dart-Code does not support (as long as they can use --write-service-info) and attach to them in a single step using a launch configuration with a preLaunchTask.
  • #2471: When starting a debug session, the VM Service URL is now printed to the Debug Console.
  • #2448: Conditional breakpoints with expressions that evaluate to numerics now work for web apps.
  • #2423: When using a new enough Dart SDK (v2.9.0 onwards) it’s now possible to debug internal Dart libraries, such as dart:http.

Editor

  • #2468: Code completion now shows full documentation instead of only a summary.
  • #2426: Flutter Icons are now shown in the gutter when running in LSP mode.
  • #2425: Flutter UI Guides are now shown in the editor (if enabled) when running in LSP mode.

Flutter

  • #2453: For web apps, the Chrome device will now be picked over the Web-server device by default.

Testing

  • #2417: The test tree now shows test durations of the last run alongside the name.

Misc

  • #2422/#2427: More of the work to find project roots at startup is now async, reducing the chance of triggering “Extension causes high CPU” warnings in VS Code.
  • #2476/#2481pub get will no longer automatically run when saving a pubspec.yaml file in a Bazel workspace.
Reply all
Reply to author
Forward
0 new messages