doomemacs / doomemacs/core

Solidity flycheck checkers doen't work

Open
#6,155 0 comments 0 reactions 0 assignees View on GitHub
is:bug needs-triage
Dominant language
Emacs Lisp
Stars
22.7k
Forks
3.1k
Avg merge
10h 46m
Merged PRs (30d)
4

Description

### What did you expect to happen?

flycheck-solidity working

### What actually happened?

flycheck-solidity doen't work

### Describe your attempts to resolve the issue

I found this on solidity project:

https://github.com/ethereum/emacs-solidity/issues/52

I think to make it work, we need to load flycheck and solidity-flycheck BEFORE solidity-mode for some reason.

I tried to modify the solidity module, no success.

A good start is settings the `solidity-flycheck-solc-checker` to t:

```
;;; lang/solidity/config.el -*- lexical-binding: t; -*-

;;
;;; Packages

(after! solidity-mode
(setq solidity-comment-style 'slash)
(set-docsets! 'solidity-mode "Solidity")
(set-company-backend! 'solidity-mode 'company-solidity)

(use-package! solidity-flycheck ; included with solidity-mode
:when (featurep! :checkers syntax)
:config
(setq flycheck-solidity-solc-addstd-contracts t)
(when (funcall flycheck-executable-find solidity-solc-path)
(setq solidity-flycheck-solc-checker-active t)
(add-to-list 'flycheck-checkers 'solidity-checker nil #'eq))
(when (funcall flycheck-executable-find solidity-solium-path)
(unless solidity-flycheck-solc-checker-active (setq solidity-flycheck-solium-checker-active t))
(add-to-list 'flycheck-checkers 'solium-checker nil #'eq)))

(use-package! company-solidity
:when (featurep! :completion company)
:config (delq! 'company-solidity company-backends)))
```

### Steps to reproduce

Install solc
Open a .sol file

(example: )

```
// SPDX-License-Identifier: Mit

pragma solidity ^0.6.0;

contract SimpleStorage {
uint256 favoriteNumber;
bool favoreitebool;

struct People {
uint256 favoriteNumber
string name;
}

People[] public people;

mapping(string => uint256) public nameToFavoriteNumber;

function store(uint256 _favoriteNumber) public {
favoriteNumber = _favoriteNumber;
}

function retrieve() public view returns(uint256) {
return favoriteNumber;
}

function addPerson(uint256 _favoriteNumber, string memory _name) public {
people.push(People({ favoriteNumber: _favoriteNumber, name: _name }));
nameToFavoriteNumber[_name] = _favoriteNumber;
}
}
```

Vim VS Emacs:
![image](https://user-images.githubusercontent.com/9551316/155799933-54215a54-d6d8-46e5-a1a6-d109399d2dc8.png)

### System Information

https://pastebin.com/FRVuj6YM

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.