luasolidityneovimlanguage-server-protocollunarvim

Lunar vim does not highlight syntax error on solidity, the default LSP does not show


When I was coding on solidity the syntax erros did not appear, every time I need to compile to solve see compilation problems.

I tried to download several plugins to Lunar VIM, tried to add vscode plugins too but did not work.


Solution

  • I found a way to solve this by install global nomicfoundation-solidity-language-server and change config.lua solidity LSP.

    Install nomicfoundation-solidity-language-server globally

    npm install @nomicfoundation/solidity-language-server -g
    

    Change config.lua

    local lspconfig = require 'lspconfig'
    local configs = require 'lspconfig.configs'
    
    configs.solidity = {
     default_config = {
     cmd = {'nomicfoundation-solidity-language-server', '--stdio'},
     filetypes = { 'solidity' },
     root_dir = lspconfig.util.find_git_ancestor,
     single_file_support = true,
     },
    }