Closed oliverswitzer closed 1 year ago
also experiencing this. Any workarounds?
Also experiencing this issue.
I spent a bit of time to look into the issue, though I do not know Go myself.
by supplying a -log flag to arduino-language-server within coc-settings.json I noticed an error with output generated by ls/builder.go . In the function generateBuildEnvironment, the local variable overridesJSON receives a path to a non-existent directory. This was logged as an error in the inols-err.log. I went into ls/builder.go and removed all usage of overridesJSON, and replaced its usage in the args constructor with buildPath.String().
This cleared out the error, but later on caused the arduino LSP to panic:
Panic: unimplemented request: workspace/semanticTokens/refresh
I reverted my code changes such that overridesJSON would refer to a non-existent directory again however this no longer seemed to be an issue, and now the LSP will continue to panic in the same manner whenever an ino file is opened.
Try disabling lsp semantic tokens (https://www.reddit.com/r/neovim/comments/zjqquc/how_do_i_turn_off_semantic_tokens/). Apparently the server does not support them and are disabled by default (https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#arduino_language_server, see capabilities)
I faced the same error, and I found this error is because of the way of finding a file name in arduino-cli. The algorithm is "root directory" + "ino". For example, since your directory is arduino-playground, the language server tries to find arduino-playground.ino, not fibonacci.ino, which is the reason for the error.
Thanks for explaining the cause of the reported error @kons-9. Arduino sketches must contain a .ino
file with name matching the sketch folder:
https://arduino.github.io/arduino-cli/dev/sketch-specification/#primary-sketch-file
Describe the problem
Hi,
I am seeing some odd logs that I can't quite make sense of that seem related to communication happening between arduino-language-server and my local clang install:
I am using nvim + nvim-config + lsp-installer to try and get arduino-language-server working for my local nvim setup.
When opening a file titled
fibonacci.ino
(a blank arduino file), I see the following output in the logs (I have turned on LSP tracing). There is additional output, but didn't want to post a wall of text, but let me know if you'd like to see more:lsp.log
:Here's the log directly from arduino-language-server (less noisy):
Here is my nvim lsp setup:
note that I've tried explicitly passing
-clangd /usr/bin/clangd
as well with no luck.Version of arduino-cli:
clang version:
I am using the latest released version of arduino-language-server from a
go install
(unclear to me from --help how to get the current version of arduino-language-server)Any help or insight you could provide on why this is not working or what these log lines imply would be greatly appreciated. Thank you in advance!
To reproduce
nvim any_arduino_file.ino with the setup delineated above.
Expected behavior
client 8 quit with exit code 2 and signal 0
in the nvim editor, and the log lines listed above in mylsp.log
file.Arduino Language Server version
0.7.4
Arduino CLI version
0.31.0 Commit: 940c9457 Date: 2023-02-20T15:09:19Z
Operating system
macOS
Operating system version
13.2.1 (22D68) - Ventura
Additional context
No response
Issue checklist