|
49 | 49 | :type 'string
|
50 | 50 | :package-version '(solidity . "0.1.1"))
|
51 | 51 |
|
52 |
| -(defcustom solidity-solc-extra-args "" |
53 |
| - "Extra arguments to add to pass to the solidity compiler." |
54 |
| - :group 'solidity |
55 |
| - :type 'string |
56 |
| - :package-version '(solidity . "0.1.2")) |
57 |
| - |
58 | 52 | (defvar solidity-mode-map
|
59 | 53 | (let ((map (make-keymap)))
|
60 | 54 | (define-key map "\C-j" 'newline-and-indent)
|
|
63 | 57 |
|
64 | 58 | (defvar solidity-checker t "The solidity flycheck syntax checker.")
|
65 | 59 | (defvar solidity-mode t "The solidity major mode.")
|
66 |
| -(defvar flycheck-solidity-executable t "The solc executable used by flycheck.") |
67 | 60 |
|
68 | 61 | ;;;###autoload
|
69 | 62 | (add-to-list 'auto-mode-alist '("\\.sol\\'" . solidity-mode))
|
@@ -451,13 +444,24 @@ Highlight the 1st result."
|
451 | 444 |
|
452 | 445 | ;;; --- interface with flycheck if existing ---
|
453 | 446 | (when (eval-when-compile (require 'flycheck nil 'noerror))
|
| 447 | + (flycheck-def-option-var flycheck-solidity-addstd-contracts nil solidity-checker |
| 448 | + "Whether to add standard solidity contracts. |
| 449 | +
|
| 450 | +When non-nil, enable add also standard solidity contracts via |
| 451 | +`--add-std'." |
| 452 | + :type 'boolean |
| 453 | + :safe #'booleanp |
| 454 | + :package-version '(solidity-mode . "0.1.3")) |
| 455 | + |
454 | 456 | ;; add dummy source-inplace definition to avoid errors
|
455 | 457 | (defvar source-inplace t)
|
456 | 458 | ;; add a solidity mode callback to set the executable of solc for flycheck
|
457 | 459 | ;; define solidity's flycheck syntax checker
|
458 | 460 | (flycheck-define-checker solidity-checker
|
459 | 461 | "A Solidity syntax checker using the solc compiler"
|
460 |
| - :command ("/usr/bin/solc" source-inplace) |
| 462 | + :command ("solc" |
| 463 | + (option-flag "--add-std" flycheck-solidity-addstd-contracts) |
| 464 | + source-inplace) |
461 | 465 | :error-patterns
|
462 | 466 | ((error line-start (file-name) ":" line ":" column ":" " Error: " (message))
|
463 | 467 | (error line-start "Error: " (message))
|
|
0 commit comments