mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-24 03:50:24 +10:00
Moving to Doom Emacs!
This commit is contained in:
47
.emacs.d/modules/lang/solidity/README.org
Normal file
47
.emacs.d/modules/lang/solidity/README.org
Normal file
@@ -0,0 +1,47 @@
|
||||
#+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~)
|
||||
|
||||
* Table of Contents :TOC:
|
||||
- [[#module-flags][Module Flags]]
|
||||
- [[#prerequisites][Prerequisites]]
|
||||
- [[#solc][Solc]]
|
||||
- [[#solium][Solium]]
|
||||
- [[#todo][TODO]]
|
||||
|
||||
* Module Flags
|
||||
This module provides no flags.
|
||||
|
||||
* Prerequisites
|
||||
This module requires one or both linters for syntax checking:
|
||||
|
||||
+ [[https://github.com/ethereum/solc-js][Solc]]
|
||||
+ [[http://solium.readthedocs.io/en/latest/user-guide.html#installation][Solium]]
|
||||
|
||||
If both are enabled *Solc* is run first, then *Solium* if *Solc* catches no
|
||||
errors.
|
||||
|
||||
** Solc
|
||||
#+BEGIN_SRC sh
|
||||
npm install -g solc
|
||||
#+END_SRC
|
||||
|
||||
** 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 "~/.soliumrc.json")
|
||||
#+END_SRC
|
||||
|
||||
* TODO
|
||||
+ Snippets
|
||||
26
.emacs.d/modules/lang/solidity/config.el
Normal file
26
.emacs.d/modules/lang/solidity/config.el
Normal file
@@ -0,0 +1,26 @@
|
||||
;;; lang/solidity/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;
|
||||
;; Packages
|
||||
|
||||
;;;###package solidity-mode
|
||||
(setq solidity-comment-style 'slash)
|
||||
|
||||
|
||||
(use-package! solidity-flycheck ; included with solidity-mode
|
||||
:when (featurep! :tools flycheck)
|
||||
:after solidity-mode
|
||||
:config
|
||||
(setq flycheck-solidity-solc-addstd-contracts t)
|
||||
(when (funcall flycheck-executable-find solidity-solc-path)
|
||||
(add-to-list 'flycheck-checkers 'solidity-checker nil #'eq))
|
||||
(when (funcall flycheck-executable-find solidity-solium-path)
|
||||
(add-to-list 'flycheck-checkers 'solium-checker nil #'eq)))
|
||||
|
||||
|
||||
(use-package! company-solidity
|
||||
:when (featurep! :completion company)
|
||||
:after solidity-mode
|
||||
:config
|
||||
(delq! 'company-solidity company-backends)
|
||||
(set-company-backend! 'solidity-mode 'company-solidity))
|
||||
8
.emacs.d/modules/lang/solidity/doctor.el
Normal file
8
.emacs.d/modules/lang/solidity/doctor.el
Normal file
@@ -0,0 +1,8 @@
|
||||
;; -*- lexical-binding: t; no-byte-compile: t; -*-
|
||||
;;; lang/solidity/doctor.el
|
||||
|
||||
(when (require 'solidity-common nil t)
|
||||
(unless (executable-find solidity-solc-path)
|
||||
(warn! "Solc isn't installed."))
|
||||
(unless (executable-find solidity-solium-path)
|
||||
(warn! "Solium isn't installed.")))
|
||||
6
.emacs.d/modules/lang/solidity/packages.el
Normal file
6
.emacs.d/modules/lang/solidity/packages.el
Normal file
@@ -0,0 +1,6 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/solidity/packages.el
|
||||
|
||||
(package! solidity-mode)
|
||||
(package! company-solidity)
|
||||
(package! solidity-flycheck)
|
||||
Reference in New Issue
Block a user