Add solidity layer
This commit is contained in:
parent
8bb98bcffa
commit
df34916300
|
@ -325,6 +325,7 @@ sane way, here is the complete list of changed key bindings
|
|||
- perl6 (thanks to Bahtiar Gadimov and yuhan0)
|
||||
- prolog (thanks to Newres Al Haider)
|
||||
- reasonml (thanks to fredyr and Dave Aitken)
|
||||
- solidity (thanks to Brooklyn Zelenka)
|
||||
- protobuf (thanks to Amol Mandhane)
|
||||
- restructuredtext (thanks to Wei-Wei Guo and Kalle Lindqvist)
|
||||
- semantic-web (thanks to Andreas Textor)
|
||||
|
@ -2722,6 +2723,9 @@ Other:
|
|||
- Fixed =helm= menu display (thanks to Leslie Shawn Russell)
|
||||
**** Smex
|
||||
- Fixed ~SPC m :~ for current major mode commands (thanks to tinysong)
|
||||
**** Solidity
|
||||
- Key bindings:
|
||||
- Added ~SPC m g~ Estimate gas at point (thanks to Brooklyn Zelenka)
|
||||
**** Source control
|
||||
- Install orgit only when org package is used (thanks to Boris Buliga)
|
||||
- Defer git-gutter loading (thanks to Aaron Jensen)
|
||||
|
|
73
layers/+lang/solidity/README.org
Normal file
73
layers/+lang/solidity/README.org
Normal file
|
@ -0,0 +1,73 @@
|
|||
#+TITLE: Solidity Layer
|
||||
|
||||
[[file:img/solidity.png]]
|
||||
|
||||
* Table of Contents :TOC_4_gh:noexport:
|
||||
- [[#description][Description]]
|
||||
- [[#features][Features:]]
|
||||
- [[#install][Install]]
|
||||
- [[#layer][Layer]]
|
||||
- [[#linter][Linter]]
|
||||
- [[#solc][solc]]
|
||||
- [[#ethlint][Ethlint]]
|
||||
- [[#options][Options]]
|
||||
- [[#key-bindings][Key bindings]]
|
||||
|
||||
* Description
|
||||
|
||||
A layer to support Solidity development in Spacemacs.
|
||||
|
||||
** Features:
|
||||
- Syntax highlighting
|
||||
- Syntax checking
|
||||
- Gas estimation
|
||||
|
||||
* Install
|
||||
** Layer
|
||||
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
|
||||
add =solidity= to the existing =dotspacemacs-configuration-layers= list in this
|
||||
file.
|
||||
|
||||
** Linter
|
||||
*** solc
|
||||
To use the solc flycheck checker, install [[https://solidity.readthedocs.io][solc]], and enable it in your =~/.spacemacs=.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(solidity :variables
|
||||
solidity-flycheck-solc-checker-active t)
|
||||
#+END_SRC
|
||||
|
||||
Please note that you can't use [[https://github.com/ethereum/solc-js][solc-js]] for the solc flycheck checker.
|
||||
|
||||
*** Ethlint
|
||||
To use solium flycheck checker, install [[https://github.com/duaraghav8/Ethlint][Ethlint]].
|
||||
|
||||
#+BEGIN_SRC sh
|
||||
npm i -g ethlint
|
||||
#+END_SRC
|
||||
|
||||
Then enable it in your =~/.spacemacs=:
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(solidity :variables
|
||||
solidity-flycheck-solium-checker-active t)
|
||||
#+END_SRC
|
||||
|
||||
And make sure that =.soliumrc.json= exists in the root directory of your DApp:
|
||||
|
||||
#+BEGIN_SRC sh
|
||||
solium --init
|
||||
#+END_SRC
|
||||
|
||||
* Options
|
||||
|
||||
| Variable | Default value | Description |
|
||||
|-------------------------------------------+---------------+------------------------------------------------------------|
|
||||
| =solidity-flycheck-solc-checker-active= | =nil= | If non-nil, use solc flycheck checker for Solidity Mode. |
|
||||
| =solidity-flycheck-solium-checker-active= | =nil= | If non-nil, use solium flycheck checker for Solidity Mode. |
|
||||
|
||||
* Key bindings
|
||||
|
||||
| Key Binding | Description |
|
||||
|-------------+-----------------------|
|
||||
| ~SPC m g~ | Estimate gas at point |
|
BIN
layers/+lang/solidity/img/solidity.png
Normal file
BIN
layers/+lang/solidity/img/solidity.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
12
layers/+lang/solidity/layers.el
Normal file
12
layers/+lang/solidity/layers.el
Normal file
|
@ -0,0 +1,12 @@
|
|||
;;; layers.el --- Solidity Layer Configuration File for Spacemacs
|
||||
;;
|
||||
;; Copyright (c) 2012-2019 Sylvain Benner & Contributors
|
||||
;;
|
||||
;; Author: Seong Yong-ju <sei40kr@gmail.com>
|
||||
;; URL: https://github.com/syl20bnr/spacemacs
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
;;
|
||||
;;; License: GPLv3
|
||||
|
||||
(configuration-layer/declare-layer-dependencies '(node))
|
38
layers/+lang/solidity/packages.el
Normal file
38
layers/+lang/solidity/packages.el
Normal file
|
@ -0,0 +1,38 @@
|
|||
;;; packages.el --- solidity layer packages file for Spacemacs.
|
||||
;;
|
||||
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
|
||||
;;
|
||||
;; Author: Brooklyn Zelenka <be.zelenka@gmail.com>
|
||||
;; URL: https://github.com/syl20bnr/spacemacs
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
;;
|
||||
;;; License: GPLv3
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defconst solidity-packages
|
||||
'(
|
||||
add-node-modules-path
|
||||
flycheck
|
||||
solidity-mode
|
||||
solidity-flycheck))
|
||||
|
||||
(defun solidity/post-init-add-node-modules-path ()
|
||||
(add-hook 'solidity-mode-hook #'add-node-modules-path))
|
||||
|
||||
(defun solidity/init-solidity-mode ()
|
||||
(use-package solidity-mode
|
||||
:defer t
|
||||
:config
|
||||
(spacemacs/set-leader-keys-for-major-mode 'solidity-mode
|
||||
"g" #'solidity-estimate-gas-at-point)))
|
||||
|
||||
(defun solidity/post-init-flycheck ()
|
||||
(spacemacs/enable-flycheck 'solidity-mode))
|
||||
|
||||
(defun solidity/init-solidity-flycheck ()
|
||||
(use-package solidity-flycheck
|
||||
:defer t
|
||||
:init
|
||||
(add-hook 'solidity-mode-hook #'(lambda () (require 'solidity-flycheck)))))
|
Loading…
Reference in a new issue