emacs-solidity icon indicating copy to clipboard operation
emacs-solidity copied to clipboard

No syntax checker detected by Flycheck

Open asymmetric opened this issue 6 years ago • 7 comments

Hi, I have set all the required configuration properties in my ~/.spacemacs, but when I run flycheck-verify-setup on a Solidity file, the output is:

Syntax checkers for buffer Foo.sol in solidity-mode:

There are no syntax checkers for this buffer!

Flycheck Mode is enabled. Use SPC u C-c ! x to enable disabled checkers.

--------------------

Flycheck version: 32snapshot (package: 20190108.351)
Emacs version:    26.1
System:           x86_64-pc-linux-gnu
Window system:    nil

This seems to be a different problem than solc not being found - it's rather the checker itself that's not found by flycheck.

I'm using Spacemacs develop [email protected] and have recently updated all packages.

asymmetric avatar Jan 22 '19 10:01 asymmetric

Hello @asymmetric.

I don't really know how spacemacs works. Have you properly loaded solidity-flycheck.el and is solidity-flycheck-solc-checker-active set to t as per the configuration guide?

LefterisJP avatar Jan 28 '19 16:01 LefterisJP

Hi @asymmetric. I have the same problem (also in Spacemacs). Did you manage to solve this?

asgeir-s avatar Feb 24 '19 18:02 asgeir-s

Nope, I ended up switching back to (neo)vim ;)

asymmetric avatar Feb 24 '19 19:02 asymmetric

Getting the same error in 'doom-emacs'.

I dont know how this is related, but when I select the solidity and solium checkers from flycheck-disable-checker I get this:

read-flycheck-checker: solidity-checker is not a valid Flycheck syntax checker
read-flycheck-checker: solium-checker is not a valid Flycheck syntax checker

asgeir-s avatar Feb 25 '19 22:02 asgeir-s

Hey @LefterisJP I'm getting the same issue, but I'm not using spacemacs. I'm using about as vanilla of an emacs set up as it gets (I just installed it this week). As such I'm very new to emacs, so it's very possible I am making an obvious mistake, but I can provide more information here to see if it is the same problem these guys were having.

I installed all the necessary packages using M-x package-install. Here is my entire .emacs config file:


;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "http://melpa.org/packages/") t)
(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.
 '(menu-bar-mode nil)
 '(package-selected-packages (quote (solidity-flycheck flycheck solidity-mode magit)))
 '(tool-bar-mode nil))
(custom-set-faces
 ;; custom-set-faces 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.
 )

(global-set-key (kbd "C-x g") 'magit-status)

(require 'solidity-flycheck)

(setq solidity-comment-style 'slash)

(add-hook 'after-init-hook #'global-flycheck-mode)

(setq solidity-solc-path "/usr/bin/solc")

(setq solidity-flycheck-solc-checker-active t)

And this is what I see when I run flycheck-verify-setup in a solidity file:

Syntax checkers for buffer ApplicationRegistry.sol in solidity-mode:

No checker to run in this buffer.

No checkers are available for this buffer.

Flycheck Mode is enabled.  Use C-u C-c ! x to enable disabled
checkers.

--------------------

Flycheck version: 32snapshot (package: 20190702.1245)
Emacs version:    26.2
System:           x86_64-pc-linux-gnu
Window system:    x

max-two avatar Jul 02 '19 20:07 max-two

Hey @MaxWMcKinley

Thanks for using solidity mode. I reproduced your problem and it's a misconfiguration that's easily fixable.

In order for settings to a package like solidity-mode to take effect you should set them before the (require ..) of the package.

So if you change your init file after magit status set to the following it should work:


(setq solidity-comment-style 'slash)

(add-hook 'after-init-hook #'global-flycheck-mode)

(setq solidity-solc-path "/usr/bin/solc")

(setq solidity-flycheck-solc-checker-active t)

(require 'solidity-flycheck)

LefterisJP avatar Jul 07 '19 08:07 LefterisJP

@LefterisJP That fixed it, thanks! I expected it would be something simple like that.

Follow up question, and feel free to tell me to open a new issue if that is more appropriate, but after having added these packages, on start up emacs says there is an issue in my .emacs file and lists this following error:

Symbol's value as variable is void: solidity-keywords

It doesn't seem to actually stop anything from working, so it's not a huge deal, but would prefer to not have any errors in my init file. Also I don't have "solidity-keywords" anywhere in the .emacs file so I am assuming it is coming from one of these packages that I am importing. Do you know what is happening here?

max-two avatar Jul 08 '19 23:07 max-two