Neovim lsp unused variables bug

Hi everyone, I’m using Neovim and the lsp linter presents a bug that tags all my variables as unused if passed as arguments or in different blocks. If anyone knows how to fix it I would be grateful (or instructions in how to disable those warnings would be appreciated in the worst case).


(unused warning when variable is passed as an argument)

It also happens in the last block of a if/elseif/else conditional.

(Saving the file does not solve the problem for me)