spacemacs/layers/+lang/dart
duianto a069c6125a [dart] Add dart-server package
dart-mode has been split into two packages:
- dart-mode, Provides basic syntax highlighting and indentation.
- dart-server, Factors out the features from dart-mode.el that relied on
external executables, thus improving availability, reliability, testing and
development of dart-mode.el.
2019-09-23 19:18:33 +02:00
..
img
config.el [dart] Add dart-server package 2019-09-23 19:18:33 +02:00
funcs.el Add flutter and lsp support to dart layer 2019-09-22 21:21:06 +02:00
packages.el [dart] Add dart-server package 2019-09-23 19:18:33 +02:00
README.org [dart] Add dart-server package 2019-09-23 19:18:33 +02:00

dart layer

/TakeV/spacemacs/media/commit/a069c6125a38193e19f14228d4d8b15aeae20fc0/layers/+lang/dart/img/dart.png

Description

This layer adds support for Dart language, and could be optionally used for Flutter development as well.

Features:

  • Syntax Highlight
  • Error checking with flycheck
  • Go to Definition
  • Dart Analyzer integration
  • Key bindings

Install

Layer

To use this configuration layer, add it to your ~/.spacemacs. You will need to add dart to the existing dotspacemacs-configuration-layers list in this file.

Dart SDK location

The layer itself will use the dart executable location if available on the execution path, but it is possible to define the location manually. It should point to the folder, and end with /.

  (dart :variables dart-server-sdk-path "~/path/to/dart-sdk/")

Flutter integration

Flutter comes with a internal Dart SDK, which can be used to provide all the integration tools.

  (dart :variables dart-server-sdk-path "<flutter-path>/bin/cache/dart-sdk/")

Configuration

For additional variables check the dart-server documentation.

Use analysis server

  (dart :variables dart-server-enable-analysis-server t)

Format on save

  (dart :variables dart-server-format-on-save t)

Key bindings

Normal mode

Some of the commands will instantiate a new Dart Analyzer server if necessary, while others work without using a Dart Analyzer connection.

When dart-server-enable-analysis-server is enabled, most of the commands become Async, and there might be a delay when executing them.

Key binding Description
SPC m h h, SPC m ? Displays hover information for the current point.
SPC m h b Displays information at point on a new buffer.
gd, SPC m g Go to definition.
SPC m f f Find reference at point.
SPC m f d Find members declarations by name.
SPC m f r Find members references by name.
SPC m f d Find top-level declarations by name.
SPC m = Format buffer

Insert mode

Key binding Description
<tab> Expand previous word using Analyzer if available
C-<tab> Expand including parameters

Popup screens

Key binding Description
q Close popup
gr Execute last command to repopulate buffer