spacemacs/layers/+lang/dart/packages.el
Bruno Tavares 9e2da23c12 Removes workarounds and update flycheck integration
This commit removes the workarounds needed on older versions of `dart-mode` library, now that many of the fixes have landed.

This commit also fixes the integration with flycheck, as there is a new function used on the `develop` branch.
2019-04-12 18:00:00 +02:00

57 lines
1.5 KiB
EmacsLisp

;;; packages.el --- dart layer packages file for Spacemacs.
;;
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
;;
;; Author: Bruno Tavares <connect+spacemacs@bltavares.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;;; Code:
;; TODO: offer lsp integration
(defconst dart-packages
'(dart-mode
flycheck))
(defun dart/show-buffer ()
"Shows information at point on a new buffer"
(interactive)
(dart-show-hover 't))
(defun dart/init-dart-mode ()
(use-package dart-mode
:defer t
:mode "\\.dart\\'"
:init
(progn
(spacemacs/declare-prefix-for-mode 'dart-mode "mf" "find")
(spacemacs/declare-prefix-for-mode 'dart-mode "mh" "help")
(spacemacs/set-leader-keys-for-major-mode 'dart-mode
"=" 'dart-format
"?" 'dart-show-hover
"g" 'dart-goto
"hh" 'dart-show-hover
"hb" 'dart/show-buffer
"ff" 'dart-find-refs
"fe" 'dart-find-member-decls
"fr" 'dart-find-member-refs
"fd" 'dart-find-top-level-decls)
(add-to-list 'spacemacs-jump-handlers-dart-mode '(dart-goto :async t))
(evil-define-key 'insert dart-mode-map
(kbd "<tab>") 'dart-expand
(kbd "C-<tab>") 'dart-expand-parameters)
(evil-set-initial-state 'dart-popup-mode 'motion)
(evil-define-key 'motion dart-popup-mode-map
(kbd "gr") 'dart-do-it-again))))
(defun dart/post-init-flycheck ()
(spacemacs/enable-flycheck 'dart-mode))
;;; packages.el ends here