Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solidity-flycheck requires el package to be included in source, otherwise does not work #74

Open
RusAlex opened this issue Jul 17, 2021 · 3 comments

Comments

@RusAlex
Copy link

RusAlex commented Jul 17, 2021

Hello. I spent some time to set it up. And isolated the error till found what happens in the code.

Versions installed from Melpa with "package" system.

solidity-flycheck: Commit: 5f6ef3156fadae5af6f381d674d20535529a20e4
flyicheck:     Version: 20210708.1337
Commit: 21d52264aa80bfa4ede94c59e37a20fb6d033b0c
solidity-mode: Commit: Commit: 5f6ef3156fadae5af6f381d674d20535529a20e4

.emacs init file

(require 'package)
(package-initialize) ;; You might already have this line
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages
   '(solidity-flycheck solidity-mode))
 )

(setq solidity-flycheck-solc-checker-active t)
(setq solidity-solc-path "/home/user/.local/bin/solc")

(add-hook 'solidity-mode-hook
          '(lambda()
             (require 'solidity-flycheck)
             (flycheck-mode +1)
             (flycheck-verify-setup)
             ))
```

then run console command emacs -nw Contract.sol emacs starts but
displays the error: File mode specification error: (void-function
remove-if-not)

I made some research and found that this is the function from the cl
package. Then I added the line (require 'cl) on the top of
solidity-flycheck.el and everything now works.

@0xDmtri
Copy link

0xDmtri commented Aug 20, 2021

Hi @RusAlex,

I am still getting the same error even when I added your changes. Also, my Doom is complaining on (require 'cl), saying its deprecated and suggest to use "cl-lib" instead. That's my .config. Would appreciate any help, thanks!

;; Solidity config
(require 'solidity-mode)
;; (add-hook 'after-init-hook #'global-flycheck-mode)
(setq solidity-solc-path "/usr/local/bin/solc")
(setq solidity-solium-path "/usr/local/bin/solium")
;; (setq flycheck-solidity-solium-soliumrcfile "/Users/bad-jew/.local/solium/.soliumrc.json")

(setq solidity-flycheck-solc-checker-active t)
(setq solidity-flycheck-solium-checker-active t)
(setq flycheck-solidity-solc-addstd-contracts t)
(require 'solidity-flycheck)

(require 'company-solidity)
(add-hook 'solidity-mode-hook
          (lambda ()
            (set (make-local-variable 'company-backends)
                 (append '((company-solidity company-capf company-dabbrev-code))
                         company-backends))))

@LefterisJP
Copy link
Collaborator

If you guys manage to fix the problem and can confirm it works fine for you then a PR would be appreciated.

@RusAlex
Copy link
Author

RusAlex commented Aug 29, 2021

I am not sure about readiness/correctness my solution. Seems it does not work for some people. And even for you @LefterisJP if it works without my fix then maybe it's with my versions of environment problem not project problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants