Closed
Description
Bug Report
Nothings happens when I set the path to ArduinoCLI config
Current behavior
go get -u github.com/arduino/arduino-language-server
go build
./arduino-language-server -cli-config $HOME/.arduino15/arduino-cli.yaml # nothings happen here
I didn't get any response after I run this command ./arduino-language-server -cli-config $HOME/.arduino15/arduino-cli.yaml
so I just always hit ^C then the terminal always says this:
2021/09/28 17:12:17 INTERRUPTED
2021/09/28 17:12:17 removing buildpath
Expected behavior
I don't really know what must happen after I run ./arduino-language-server -cli-config <path-to-cli-config>
because there is no example on the documentation
Environment
- Language Server version (commit hash): bbba79f
- CLI version used (output of
arduino-cli version
):arduino-cli alpha Version: 0.19.0 Commit: 56419ecd Date: 2021-09-02T14:47:35Z - OS and platform: Ubuntu 20.04.2
Activity
dylanashcraft commentedon Dec 7, 2021
Commit 08181a1
M1 Architecture
arduino-cli Version: 0.20.1 Commit: abb21449 Date: 2021-11-26T09:52:53Z
Issue:
Same results as PaoGon. arduino-language-server -cli-config does not accept relative or full path as string. No results after waiting 5 minutes.
Input:
./arduino-language-server -cli-config ~/Library/Arduino15/arduino-cli.yaml
Output:
husseljoo commentedon Dec 10, 2021
I have the same issue. I left it for as long as 4hrs and still no response.
husseljoo commentedon Dec 11, 2021
@per1234 is there any workaround to this?
cmaglie commentedon Dec 11, 2021
It's normal that you don't see any output because the language server is waiting for the
initialize
command. Anyway, it's not intended for usage by humans via the command line as you expect.The Arduino language server is an implementation of the LSP (Language Server Protocol) specification: https://microsoft.github.io/language-server-protocol/specifications/specification-current/. The purpose of this program is to provide language-related functionality to the IDEs so, in general, it's the IDE that talks to the language server via stdin/stdout using the slightly modified JSONRPC protocol defined in the LSP specification.
Hope this helps, we should probably explain this better in the README, so I'll keep this issue open until then.
husseljoo commentedon Dec 11, 2021
Is there any guide on how to make the arduino-language-server to work on nvim lsp? It seems that cli-config has to be included/declared somehow. How does one go about this?
cmaglie commentedon Dec 11, 2021
Nope, sorry, we are developing mainly for the Arduino IDE, I've no idea how to configure nvim...
Anyway, if you want to give it a try yourself, you need to put together three pieces of the puzzle:
arduino-cli core install ...
)The Arduino language server uses clangd under the hood, that's the reason why it is required.
I suggest to build the arduino-language-server from this branch: #89 that has a TON of bugfixes(EDIT: the PR has now been merged)On the Arduino IDE the command line we use to start the language server is something like:
you must configure nvim to do something similar when starting the language server.
The
-fqbn
flag represents the board you're actually working on (different boards may implement different features/API, if you change board you need to restart the language server with another fqbn).If everything goes right you should be able to edit .ino files and ask for completions, get errors/warnings in real time, etc. etc.
BTW keep in mind that the language server is not 100% accurate, it's really tricky, and we are getting a lot of bug reports.
If you want to see some logging you can add the flags:
this will make the language server output a lot of logging data in the specified folder.
PaoGon commentedon Dec 24, 2021
Sorry for my late response I already fixed this. So it seems that we do not need to run this on the terminal
./arduino-language-server -cli-config $HOME/.arduino15/arduino-cli.yaml
, we just need to put this on the arduino language server setup in neovim.per1234 commentedon Jun 22, 2022
The readme has since been updated to explain this situation: 52d96f0
It will also be explained by the tool output itself: #119