Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

arduino-language-server does not error on failed compilation from arduino-cli #79

Open
Assignees
Labels
topic: codeRelated to content of the project itself type: imperfectionPerceived defect in any part of project
@danieldides

Description

Bug Report

Current behavior

When starting the language server (I'm using neovim's LSP client), the invocation to the arduino-cli tool for a compilation step before calling clangd can error out without crashing the language server. This causes an ambiguous behavior where the language server appears to be operating and waiting on clangd, but has failed a necessary step to invoke the server.

Expected behavior

I would expect the language server to crash on failure to pre-process the ino files into cpp files and pass off to clangd. It might even make sense to show an error message here that suggests there's an issue with the arduino-cli involvement and to investigate there. For me, I had not installed the the platform core for the board.

The arduino-cli responds with a JSON object noting that the compiler has failed. I think on "success": false the LS should exit and display a message.

Additionally (this should be an issue on the arduino-cli project), it would be nice if the error message from the arduino-cli tool made it to the LS. All the LS receives back is:

2021年06月27日 00:24:32 arduino-cli output: {
 "compiler_out": "",
 "compiler_err": "",
 "builder_result": null,
 "success": false
}

however when compiling the code manually (not letting the LS do it for me), the error message is much more clear:

Error during build: platform not installed

Environment

  • Language Server version (commit hash): 64a0e42a7a3d713629d3066d7555fb32cf19c3ec
  • CLI version used (output of arduino-cli version): arduino-cli alpha Version: 0.18.3 Commit: d710b642 Date: 2021年05月14日T12:36:58Z
  • OS and platform: Ubuntu 20.04.1 LTS

Additional context

Started logging.
2021年06月27日 00:24:32 logging to /home/daniel/Projects/personal/arduino/OLED/inols.log
2021年06月27日 00:24:32 Initial board configuration: { arduino:avr:uno}
2021年06月27日 00:24:32 Language server build path: /tmp/arduino-language-server819982533
2021年06月27日 00:24:32 Language server build sketch root: /tmp/arduino-language-server819982533/sketch
2021年06月27日 00:24:32 IDE --> LS CL: REQUEST initialize 1:
2021年06月27日 00:24:32 IDE --> initialize 1 locked
2021年06月27日 00:24:32 IDE --> initialize 1 unlocked
2021年06月27日 00:24:32 IDE <-- LS CL: ANSWER UNBOUND (1):
2021年06月27日 00:24:32 INIT--- initializing workbench
2021年06月27日 00:24:32 INIT--- locked
2021年06月27日 00:24:32 --> initialize(file:///home/daniel/Projects/personal/arduino/OLED)
2021年06月27日 00:24:32 running: /home/daniel/bin/arduino-cli --config-file /home/daniel/.arduino15/arduino-cli.yaml compile --fqbn arduino:avr:uno --only-compilation-database --clean --source-override /tmp/797020000 --build-path /tmp/arduino-language-server819982533 --format json /home/daniel/Projects/personal/arduino/OLED
2021年06月27日 00:24:32 IDE --> LS CL: NOTIFICATION initialized:
2021年06月27日 00:24:32 arduino-cli output: {
 "compiler_out": "",
 "compiler_err": "",
 "builder_result": null,
 "success": false
}
2021年06月27日 00:24:32 INIT--- initializing workbench (done)
2021年06月27日 00:24:32 INIT--- unlocked
2021年06月27日 00:24:32 IDE --> initialized notif1 read-locked
2021年06月27日 00:24:32 IDE --> initialized notif1 notification is not propagated to clangd
2021年06月27日 00:24:32 IDE --> initialized notif1 read-unlocked
2021年06月27日 00:24:32 IDE --> LS CL: NOTIFICATION textDocument/didOpen:
2021年06月27日 00:24:32 IDE --> textDocument/didOpen notif2 locked
2021年06月27日 00:24:32 IDE --> textDocument/didOpen notif2 (throttled: waiting for clangd)
2021年06月27日 00:24:32 IDE --> textDocument/didOpen notif2 unlocked (waiting clangd)

Metadata

Metadata

Assignees

Labels

topic: codeRelated to content of the project itself type: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /