Dart Code can be installed from the Visual Studio Code Marketplace. Open VS Code Quick Open (Ctrl+P
) and paste the following and press enter:
ext install dart-code
- Auto-closing braces/quotes
- Document symbol list/search with highlighting
pub get
andpub upgrade
commands- Other symbol references to current symbol are highlighted
- Automatically finds Dart SDK if it is in your
PATH
environment variable
dart.sdkPath
: If the Dart SDK is not automatically found on your machine from yourPATH
you can enter the path to it here.dart.lineLength
: The maximum length of a line of code. This is used by the document formatter. Defaults to 80.dart.setIndentation
: Forces indenting with two spaces when Dart files are opened. This is on by default because VS Code doesn't currently support per-language settings and most people use tabs/4 spaces for other languages but Convention is 2 spaces. Defaults to true.dart.showTodos
: Whether to show TODOs in the Problems list. Defaults to true.dart.allowAnalytics
: Note: We only send a few very basic events and the platform and extension/Dart version numbers :-)
This extension reports some very basic events to help inform development decisions, such as:
- When the extension is loaded
- When you enabled/disable some features (eg. showTodos)
Included in the event is your platform (Win/Linux/Mac) and extension/Dart version numbers.
This can be disabled via the dart.allowAnalytics
setting.
- The display of symbols in the workspace symbol search (
Ctrl+T
) has been improved * - The Dart language service will no longer crash when you enter symbols into the (
Ctrl+T
) search box - Pressing
F5
will now allow you to run a Dart command line application (you will need to set the path in.vscode\launch.json
) ** - Organise Directives (
ctrl+alt+o
) has been added
* Filenames may not display correctly in the stable version (1.4) of Code but will be fine in the Insiders version (and the next stable release)
** Currently reading from stdin
will cause the program to hang; this will be addressed in an upcoming release
- Workspace symbol search (
Ctrl+T
) now includes more symbols from your workspace including imported packages - Document symbol list/search has been implemented (
Ctrl+Shift+O
) - Document highlights have been implemented (selected a symbol will highlight other instances)
- Commands for
pub get
andpub ugprade
have been added - Errors and warnings from files that are deleted when not open will no longer hang around in the problems view
Additionally, some non-features:
- Dart-Code now builds continiously on Travis (Mac OSX + Linux) and AppVeyor (Windows)
- Analaytics now include Dart SDK and Analysis Server version numbers to help us understand what features we can use and/or drop support for
- Find References (
Shift+F12
) has been added - Open files are given higher priority for analysis operations
- The extension no longer tries (and fails) to analyze open files that are outside of workspace folder
Additionally, a new option dart.allowAnalytics
was added to control if analytics are sent. Only very basic events are captured (such as extension activation and if you toggle certain features) and are sent along with the extension version/platform. No code, filenames, project names or personal information will be sent. Source code for all analytics is visible here.
- A new option
dart.showTodos
(default:true
) has been added to show/hide TODO messages from the Problems list - "Analyzing…" will now show in the status bar when files are being analyzed
- Go to Definition is now supported within your project (though does not yet work with SDK classes)
- The Dart SDK version number will now show in the bottom right status bar
- Dart files will automatically be set to 2-space indenting when you open them
- A new option
dart.setIndentation
(default:true
) has been added to enable/disable automatic indent settings - Symbol search is now case-insensitive and also supports better filtering (eg. "TA" will match "TwitterApi")
- Tooltips reading
"undefined"
will no longer appear for some items (eg. string literals) - Tooltip formatting/display has been greatly improved
- SDK detection is more reliable on Linux/Mac
- Name changed from "Dart-Code" to "Dart Code"
- Setting added to control line-width passed to formatter
- Last used SDK path is cached to improve startup performance
- Tooltip hovers now indicate the range that they apply to
- Braces/quotes now automatically close
- Pressing enter between a set of braces will automatically indent
- Detects SDK location from PATH
- Syntax highlighting
- Basic code completion
- Realtime errors/warnings/hints reported in error window and with squiggles
- Format document
- Hovers/tooltip information
- Workspace-wide symbol search (
Ctrl+T
)