Add Solidity
Add basic Solidity module
This commit is contained in:
parent
f16aa539c7
commit
3193e7a8a7
5 changed files with 74 additions and 0 deletions
|
@ -104,6 +104,7 @@
|
||||||
rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
||||||
scala ; java, but good
|
scala ; java, but good
|
||||||
sh ; she sells (ba|z)sh shells on the C xor
|
sh ; she sells (ba|z)sh shells on the C xor
|
||||||
|
solidity ; do you need a blockchain? No.
|
||||||
swift ; who asked for emoji variables?
|
swift ; who asked for emoji variables?
|
||||||
typescript ; javascript, but better
|
typescript ; javascript, but better
|
||||||
web ; the tubes
|
web ; the tubes
|
||||||
|
|
31
modules/lang/solidity/README.org
Normal file
31
modules/lang/solidity/README.org
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
#+TITLE: :lang solidity
|
||||||
|
|
||||||
|
This module adds [[https://github.com/ethereum/solidity][Solidity]] support through [[https://github.com/ethereum/emacs-solidity][solidity-mode]]
|
||||||
|
|
||||||
|
+ Syntax-checking (~flycheck~)
|
||||||
|
+ Code completion (~[[https://github.com/ssmolkin1/company-solidity][company-solidity]]~)
|
||||||
|
+ Gas estimation(~C-c C-g~)
|
||||||
|
|
||||||
|
* Install
|
||||||
|
There are two options for linters.
|
||||||
|
|
||||||
|
** [[https://github.com/ethereum/solc-js][Solc]]
|
||||||
|
#+BEGIN_SRC sh
|
||||||
|
npm install -g solc
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** [[http://solium.readthedocs.io/en/latest/user-guide.html#installation][Solium]]
|
||||||
|
#+BEGIN_SRC sh
|
||||||
|
npm install -g solium
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
By default *solium* looks for ~.soliumrc.json~ in the project directory, but you can set it to your own ~.soliumrc.json~ with this in your private doom ~config.el~
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq flycheck-solidity-solium-soliumrcfile "/$HOME/.soliumrc.json")
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
They can be chained together so it's recommended you use both. *Solc* is ran first, and then *Solium* if *Solc* doesn't catch any errors.
|
||||||
|
|
||||||
|
* TODO
|
||||||
|
+ Snippets
|
28
modules/lang/solidity/config.el
Normal file
28
modules/lang/solidity/config.el
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
;;; lang/solidity/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;
|
||||||
|
;; Plugins
|
||||||
|
;;
|
||||||
|
|
||||||
|
(def-package! solidity-mode
|
||||||
|
:mode "\\.sol$"
|
||||||
|
:init
|
||||||
|
(setq solidity-solc-path "$HOME/.node_modules/bin/solcjs")
|
||||||
|
(setq solidity-solium-path "$HOME/.node_modules/bin/solium")
|
||||||
|
|
||||||
|
(setq solidity-flycheck-solc-checker-active t)
|
||||||
|
(setq solidity-flycheck-solium-checker-active t)
|
||||||
|
|
||||||
|
(setq flycheck-solidity-solc-addstd-contracts t)
|
||||||
|
:config
|
||||||
|
(setq solidity-comment-style 'slash))
|
||||||
|
|
||||||
|
(def-package! company-solidity
|
||||||
|
:when (featurep! :completion company)
|
||||||
|
:after solidity-mode
|
||||||
|
:config
|
||||||
|
(add-hook 'solidity-mode-hook
|
||||||
|
(lambda ()
|
||||||
|
(set (make-local-variable 'company-backends)
|
||||||
|
(append '((company-solidity company-capf company-dabbrev-code))
|
||||||
|
company-backends)))))
|
8
modules/lang/solidity/doctor.el
Normal file
8
modules/lang/solidity/doctor.el
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
;; -*- lexical-binding: t; no-byte-compile: t; -*-
|
||||||
|
;;; lang/solidity/doctor.el
|
||||||
|
|
||||||
|
(unless (executable-find "solc")
|
||||||
|
(warn! "Solc isn't installed."))
|
||||||
|
|
||||||
|
(unless (executable-find "solium -V")
|
||||||
|
(warn! "Solium isn't installed."))
|
6
modules/lang/solidity/packages.el
Normal file
6
modules/lang/solidity/packages.el
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
;; -*- no-byte-compile: t; -*-
|
||||||
|
;;; lang/solidity/packages.el
|
||||||
|
|
||||||
|
(package! solidity-mode)
|
||||||
|
(when (featurep! :completion company)
|
||||||
|
(package! company-solidity))
|
Loading…
Add table
Add a link
Reference in a new issue