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

No syntax checker detected by Flycheck #41

Open
asymmetric opened this issue Jan 22, 2019 · 7 comments
Open

No syntax checker detected by Flycheck #41

asymmetric opened this issue Jan 22, 2019 · 7 comments

Comments

@asymmetric
Copy link

asymmetric commented Jan 22, 2019

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.

@LefterisJP
Copy link
Collaborator

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?

@asgeir-s
Copy link

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

@asymmetric
Copy link
Author

asymmetric commented Feb 24, 2019

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

@asgeir-s
Copy link

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

@max-two
Copy link

max-two commented Jul 2, 2019

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

@LefterisJP
Copy link
Collaborator

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)

@max-two
Copy link

max-two commented Jul 8, 2019

@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?

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

4 participants