qiuxiang / coc-solidity

Solidity language server for coc.nvim
MIT License
48 stars 0 forks source link

how to modify "Function state mutability" warnings? #14

Open ssadler opened 1 year ago

ssadler commented 1 year ago

Hi, thanks for this great lib, it's been working very reliably since I installed it :slightly_smiling_face:

I have one small problem with it, and that is that the function state mutability warnings are assigned to the entire function block and this can be an annoyance during development process, if you are using something like hardhat's console.log. The reason is, I usually leave pure functions as views while I am testing them so i can console.log easily. But this results in a visible warning in the whole function body:

image

(in my image above the cursor is still in the function signature but you get the idea).

What I'd like is to be able to change that warning so it's only visible on the definition line of the function, not the whole body.

Is there a way to do this?

Many thanks

qiuxiang commented 1 year ago

the warning code range is provided by solc

ssadler commented 1 year ago

Hi,

I guessed that was the case... Nonetheless, I was wondering if there was a way to hook into it?