Hello, I’m running into a strange error running arduino-language-server with nvim-lspconfig.
For system info:
- Running on Arch
- nvim v0.7.2
- clang/clangd version 14.0.16
error message:
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.442446 \27[97mLS: : Initial board configuration: arduino:uvr:uno\27[0m\n23:28:52.442465 \27[97mLS: : Language server build path: /tmp/arduino-language-server3413973514\27[0m\n23:28:52.442469 \27[97mLS: : Language server build sketch root: /tmp/arduino-language-server3413973514/sketch\27[0m\n23:28:52.442472 \27[97mLS: : Language server FULL build path: /tmp/arduino-language-server2740299488\27[0m\n"
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.442615 IN Elapsed: 88.496µs\n"
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.442713 \27[92mIDE --> LS REQU initialize 1\27[0m\n"
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.443249 \27[92m initialize 1: \27[93mwrite-locked\27[0m\27[0m\n"
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.443273 \27[92m initialize 1: \27[93mwrite-unlocked\27[0m\27[0m\n"
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.443360 \27[96mINIT --- : initializing workbench: file:///home/austin/arduino/PFI\27[0m\n"
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.443388 \27[96mINIT --- : \27[93mread-locked\27[0m\27[0m\n23:28:52.443393 \27[96mINIT --- : \27[93mread-unlocked\27[0m\27[0m\n"
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.443585 \27[96mINIT --- : running: /usr/bin/arduino-cli --config-file /home/austin/.arduino15/arduino-cli.yaml compile --fqbn arduino:uvr:uno --only-compilation-database --source-override /tmp/1477699938 --build-path /tmp/arduino-language-server2740299488 --format json /home/austin/arduino/PFI\27[0m\n"
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.443667 \27[92m initialize 1: initialization parameters: {\"capabilities\":{\"textDocumentSync\":{\"openClose\":true,\"change\":2,\"save\":{\"includeText\":true}},\"completionProvider\":{\"triggerCharacters\":[\".\",\"\\u003c\",\"\\u003e\",\":\",\"\\\"\",\"/\"],\"allCommitCharacters\":[\" \",\"\\t\",\"(\",\")\",\"[\",\"]\",\"{\",\"}\",\"\\u003c\",\"\\u003e\",\":\",\";\",\",\",\"+\",\"-\",\"/\",\"*\",\"%\",\"^\",\"\\u0026\",\"#\",\"?\",\".\",\"=\",\"\\\"\",\"'\",\"|\"],\"completionItem\":{}},\"hoverProvider\":{},\"signatureHelpProvider\":{\"triggerCharacters\":[\"(\",\",\"]},\"definitionProvider\":{},\"documentHighlightProvider\":{},\"documentSymbolProvider\":{},\"codeActionProvider\":{\"codeActionKinds\":[\"quickfix\",\"refactor\",\"info\"]},\"documentFormattingProvider\":{},\"documentRangeFormattingProvider\":{},\"documentOnTypeFormattingProvider\":{\"firstTriggerCharacter\":\"\\n\"},\"renameProvider\":{},\"executeCommandProvider\":{\"commands\":[\"clangd.applyFix\",\"clangd.applyTweak\"]},\"workspaceSymbolProvider\":{}},\"serverInfo\":{\"name\":\"arduino-language-server\",\"version\":\"0.7.1\"}}\27[0m\n23:28:52.443684 \27[32mIDE <-- LS RESP initialize 1\27[0m\n"
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.443713 OUT Elapsed: 3.316µs\n"
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.443858 IN Elapsed: 142.607µs\n23:28:52.443880 \27[92mIDE --> LS NOTIF initialized\27[0m\n23:28:52.443884 \27[92m initialized: Notification is not propagated to clangd\27[0m\n"
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.443952 IN Elapsed: 65.954µs\n23:28:52.444021 \27[92mIDE --> LS NOTIF textDocument/didOpen\27[0m\n"
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.444070 \27[92m textDocument/didOpen: \27[93mwrite-locked\27[0m\27[0m\n23:28:52.444072 \27[92m textDocument/didOpen: (throttled: waiting for clangd)\27[0m\n23:28:52.444075 \27[92m textDocument/didOpen: \27[93munlocked (waiting clangd)\27[0m\27[0m\n"
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.799918 \27[96mINIT --- : error starting clang: running /usr/bin/arduino-cli --config-file /home/austin/.arduino15/arduino-cli.yaml compile --fqbn arduino:uvr:uno --only-compilation-database --source-override /tmp/1477699938 --build-path /tmp/arduino-language-server2740299488 --format json /home/austin/arduino/PFI: exit status 2\27[0m\n23:28:52.799998 \27[92m textDocument/didOpen: \27[93mlocked (waiting clangd)\27[0m\27[0m\n"
[ERROR][2022-08-06 23:28:52] .../vim/lsp/rpc.lua:420 "rpc" "arduino-language-server" "stderr" "23:28:52.800008 \27[92m textDocument/didOpen: clangd startup failed: quitting Language server\27[0m\n"
plugins:
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-nvim-lua'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
lspconfig:
local lsp_defaults = {
flags = {
debounce_text_changes = 150,
},
capabilities = require('cmp_nvim_lsp').update_capabilities(
vim.lsp.protocol.make_client_capabilities()
),
on_attach = function(client, bufnr)
vim.api.nvim_command('autocmd BufWritePre * autocmd BufWritePre * :lua vim.lsp.buf.formatting_sync()')
end
}
local lspconfig = require('lspconfig')
lspconfig.util.default_config = vim.tbl_deep_extend(
'force',
lspconfig.util.default_config,
lsp_defaults
)
-- Setup lspconfig.
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
lspconfig.arduino_language_server.setup {
cmd = {
"arduino-language-server",
"-cli-config", "/home/austin/.arduino15/arduino-cli.yaml",
"-fqbn", "arduino:uvr:uno",
"-cli", "/usr/bin/arduino-cli",
"-clangd", "/usr/bin/clangd"
}
}
ofc ask for any other info that might be relevant.
I’ve tried reinstalling clang and arduino-language-server, and I can’t reproduce this issue running arduino-language-server from the command line. Please help, and thanks!