arduino / arduino-language-server

An Arduino Language Server based on Clangd to Arduino code autocompletion
GNU Affero General Public License v3.0
138 stars 15 forks source link

LS cannot provide definitions, references. Reports errors for hover #24

Open kittaakos opened 4 years ago

kittaakos commented 4 years ago

The ino file:

void setup() {
    digitalWrite(10, 20);
    digitalPinToPort(10);
    digitalPinToPort(30);
}

void loop() {

}

Errors from the log:

root ERROR C/C++: I[13:35:07.966] <-- textDocument/hover(11)
I[13:35:07.966] --> reply:textDocument/hover(11) 0 ms, error: invalid AST
daemon INFO current best: esp32:esp32@1.0.4 [bundle: false, managed: true, version: 1.0.4]
daemon INFO current best: arduino:samd@1.8.6 [bundle: false, managed: true, version: 1.8.6]
discovery INFO Updated discovered boards and available ports. - Discovered boards: [{"name":"Arduino MKR1000","fqbn":"arduino:samd:mkr1000","port":{"address":"/dev/cu.usbmodem14601","protocol":"serial"}}] and available ports: [{"protocol":"serial","address":"/dev/cu.usbmodem14601"},{"protocol":"serial","address":"/dev/cu.usbserial-0001"},{"protocol":"serial","address":"/dev/cu.Bluetooth-Incoming-Port"},{"protocol":"serial","address":"/dev/cu.MALS"},{"protocol":"serial","address":"/dev/cu.SOC"}]
root INFO Attached boards and available ports changed:  {"oldState":{"boards":[],"ports":[]},"newState":{"boards":[{"name":"Arduino MKR1000","fqbn":"arduino:samd:mkr1000","port":{"address":"/dev/cu.usbmodem14601","protocol":"serial"}}],"ports":[{"protocol":"serial","address":"/dev/cu.usbmodem14601"},{"protocol":"serial","address":"/dev/cu.usbserial-0001"},{"protocol":"serial","address":"/dev/cu.Bluetooth-Incoming-Port"},{"protocol":"serial","address":"/dev/cu.MALS"},{"protocol":"serial","address":"/dev/cu.SOC"}]}}
daemon INFO current best: esp32:esp32@1.0.4 [bundle: false, managed: true, version: 1.0.4]
daemon INFO current best: arduino:samd@1.8.6 [bundle: false, managed: true, version: 1.8.6]
root ERROR C/C++: I[13:35:11.675] <-- textDocument/definition(12)
I[13:35:11.675] --> reply:textDocument/definition(12) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:11.826] <-- textDocument/hover(13)
I[13:35:11.826] --> reply:textDocument/hover(13) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:12.165] <-- textDocument/hover(14)
root ERROR C/C++: I[13:35:12.165] --> reply:textDocument/hover(14) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:12.469] <-- textDocument/hover(15)
root ERROR C/C++: I[13:35:12.469] --> reply:textDocument/hover(15) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:12.600] <-- textDocument/definition(16)
root ERROR C/C++: I[13:35:12.600] --> reply:textDocument/definition(16) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:12.742] <-- textDocument/definition(17)
root ERROR C/C++: I[13:35:12.742] --> reply:textDocument/definition(17) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:12.893] <-- textDocument/hover(18)
I[13:35:12.893] --> reply:textDocument/hover(18) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:13.193] <-- textDocument/hover(19)
root ERROR C/C++: I[13:35:13.193] --> reply:textDocument/hover(19) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:13.219] <-- textDocument/definition(20)
root ERROR C/C++: I[13:35:13.219] --> reply:textDocument/definition(20) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:13.494] <-- textDocument/hover(21)
root ERROR C/C++: I[13:35:13.494] --> reply:textDocument/hover(21) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:13.828] <-- textDocument/hover(22)
root ERROR C/C++: I[13:35:13.828] --> reply:textDocument/hover(22) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:13.904] <-- textDocument/definition(23)
root ERROR C/C++: I[13:35:13.904] --> reply:textDocument/definition(23) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:14.032] <-- textDocument/hover(24)
root ERROR C/C++: I[13:35:14.032] --> reply:textDocument/hover(24) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:14.180] <-- textDocument/definition(25)
root ERROR C/C++: I[13:35:14.180] --> reply:textDocument/definition(25) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:16.493] <-- textDocument/hover(26)
root ERROR C/C++: I[13:35:16.493] --> reply:textDocument/hover(26) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:16.503] <-- textDocument/definition(27)
root ERROR C/C++: I[13:35:16.503] --> reply:textDocument/definition(27) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:16.795] <-- textDocument/hover(28)
root ERROR C/C++: I[13:35:16.795] --> reply:textDocument/hover(28) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:17.096] <-- textDocument/hover(29)
root ERROR C/C++: I[13:35:17.096] --> reply:textDocument/hover(29) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:18.004] <-- textDocument/codeAction(30)
root ERROR C/C++: I[13:35:18.004] --> reply:textDocument/codeAction(30) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:18.336] <-- textDocument/didChange
root ERROR C/C++: I[13:35:18.535] <-- textDocument/didChange
root ERROR C/C++: I[13:35:18.551] <-- textDocument/completion(31)
root ERROR C/C++: I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-dac.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-dac.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
root ERROR C/C++: I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/stdlib_noniso.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/stdlib_noniso.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.552] Code complete: 0 results from Sema, 16 from Index, 0 matched, 2 from identifiers, 18 returned (incomplete).
root ERROR C/C++: I[13:35:18.553] --> reply:textDocument/completion(31) 2 ms
root ERROR C/C++: I[13:35:18.629] <-- textDocument/didChange
root ERROR C/C++: I[13:35:18.631] <-- textDocument/completion(32)
root ERROR C/C++: I[13:35:18.632] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.632] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.632] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.632] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.632] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
root ERROR C/C++: I[13:35:18.632] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.632] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.632] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.632] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.632] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.632] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.632] Failed to generate include insertion edits for adding header (FileURI='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h', IncludeHeader='file:///Users/akos.kitta/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-gpio.h') into /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino: Header not on include path
I[13:35:18.632] Code complete: 0 results from Sema, 12 from Index, 0 matched, 2 from identifiers, 14 returned (incomplete).
root ERROR C/C++: I[13:35:18.632] --> reply:textDocument/completion(32) 1 ms
root ERROR C/C++: I[13:35:18.882] <-- textDocument/codeAction(33)
root ERROR C/C++: I[13:35:18.882] Failed to find compilation database for /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino
I[13:35:18.882] Updating file /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino with command clangd fallback
[/Users/akos.kitta/Documents/Arduino/sketch_april7a]
/Users/akos.kitta/git/arduino-editor/arduino-ide-extension/build/bin/clang /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino -fsyntax-only -resource-dir=/Users/akos.kitta/git/arduino-editor/arduino-ide-extension/build/lib/clang/9.0.0
root ERROR C/C++: E[13:35:18.883] Could not build CompilerInvocation for file /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino
root ERROR C/C++: I[13:35:18.884] --> reply:textDocument/codeAction(33) 2 ms, error: invalid AST
root ERROR C/C++: I[13:35:19.148] <-- textDocument/didSave
I[13:35:19.148] unhandled notification textDocument/didSave
root ERROR C/C++: I[13:35:19.618] <-- textDocument/didChange
root ERROR C/C++: I[13:35:19.880] <-- textDocument/codeAction(34)
root ERROR C/C++: I[13:35:19.880] Failed to find compilation database for /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino
I[13:35:19.880] Updating file /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino with command clangd fallback
[/Users/akos.kitta/Documents/Arduino/sketch_april7a]
/Users/akos.kitta/git/arduino-editor/arduino-ide-extension/build/bin/clang /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino -fsyntax-only -resource-dir=/Users/akos.kitta/git/arduino-editor/arduino-ide-extension/build/lib/clang/9.0.0
root ERROR C/C++: E[13:35:19.881] Could not build CompilerInvocation for file /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino
root ERROR C/C++: I[13:35:19.882] --> reply:textDocument/codeAction(34) 1 ms, error: invalid AST
root ERROR C/C++: I[13:35:20.123] <-- textDocument/didSave
I[13:35:20.123] unhandled notification textDocument/didSave
root ERROR C/C++: I[13:35:20.522] <-- textDocument/didChange
root ERROR C/C++: I[13:35:20.647] <-- textDocument/signatureHelp(35)
root ERROR C/C++: I[13:35:20.647] Failed to find compilation database for /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino
I[13:35:20.647] Updating file /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino with command clangd fallback
[/Users/akos.kitta/Documents/Arduino/sketch_april7a]
/Users/akos.kitta/git/arduino-editor/arduino-ide-extension/build/bin/clang /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino -fsyntax-only -resource-dir=/Users/akos.kitta/git/arduino-editor/arduino-ide-extension/build/lib/clang/9.0.0
root ERROR C/C++: E[13:35:20.648] Could not build CompilerInvocation for file /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino
root ERROR C/C++: E[13:35:20.649] Couldn't create CompilerInvocation
I[13:35:20.649] --> reply:textDocument/signatureHelp(35) 2 ms
root ERROR C/C++: I[13:35:20.651] <-- textDocument/didChange
root ERROR C/C++: I[13:35:20.780] <-- textDocument/signatureHelp(36)
root ERROR C/C++: I[13:35:20.780] Failed to find compilation database for /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino
I[13:35:20.780] Updating file /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino with command clangd fallback
[/Users/akos.kitta/Documents/Arduino/sketch_april7a]
/Users/akos.kitta/git/arduino-editor/arduino-ide-extension/build/bin/clang /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino -fsyntax-only -resource-dir=/Users/akos.kitta/git/arduino-editor/arduino-ide-extension/build/lib/clang/9.0.0
root ERROR C/C++: E[13:35:20.781] Could not build CompilerInvocation for file /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino
root ERROR C/C++: E[13:35:20.781] Couldn't create CompilerInvocation
I[13:35:20.781] --> reply:textDocument/signatureHelp(36) 1 ms
root ERROR C/C++: I[13:35:21.058] <-- textDocument/codeAction(37)
root ERROR C/C++: I[13:35:21.059] --> reply:textDocument/codeAction(37) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:21.157] <-- textDocument/didSave
I[13:35:21.158] unhandled notification textDocument/didSave
root ERROR C/C++: I[13:35:21.470] <-- textDocument/didChange
root ERROR C/C++: I[13:35:21.539] <-- textDocument/didChange
root ERROR C/C++: I[13:35:21.790] <-- textDocument/codeAction(38)
I[13:35:21.790] Failed to find compilation database for /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino
root ERROR C/C++: I[13:35:21.790] Updating file /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino with command clangd fallback
[/Users/akos.kitta/Documents/Arduino/sketch_april7a]
/Users/akos.kitta/git/arduino-editor/arduino-ide-extension/build/bin/clang /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino -fsyntax-only -resource-dir=/Users/akos.kitta/git/arduino-editor/arduino-ide-extension/build/lib/clang/9.0.0
root ERROR C/C++: E[13:35:21.791] Could not build CompilerInvocation for file /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino
root ERROR C/C++: I[13:35:21.792] --> reply:textDocument/codeAction(38) 1 ms, error: invalid AST
root ERROR C/C++: I[13:35:22.043] <-- textDocument/didChange
root ERROR C/C++: I[13:35:22.295] <-- textDocument/codeAction(39)
root ERROR C/C++: I[13:35:22.295] Failed to find compilation database for /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino
I[13:35:22.295] Updating file /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino with command clangd fallback
[/Users/akos.kitta/Documents/Arduino/sketch_april7a]
/Users/akos.kitta/git/arduino-editor/arduino-ide-extension/build/bin/clang /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino -fsyntax-only -resource-dir=/Users/akos.kitta/git/arduino-editor/arduino-ide-extension/build/lib/clang/9.0.0
root ERROR C/C++: E[13:35:22.296] Could not build CompilerInvocation for file /Users/akos.kitta/Documents/Arduino/sketch_april7a/sketch_april7a.ino
root ERROR C/C++: I[13:35:22.297] --> reply:textDocument/codeAction(39) 1 ms, error: invalid AST
root ERROR C/C++: I[13:35:22.552] <-- textDocument/didSave
I[13:35:22.553] unhandled notification textDocument/didSave
root ERROR C/C++: I[13:35:22.664] <-- textDocument/definition(40)
root ERROR C/C++: I[13:35:22.664] --> reply:textDocument/definition(40) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:22.848] <-- textDocument/definition(41)
root ERROR C/C++: I[13:35:22.848] --> reply:textDocument/definition(41) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:23.206] <-- textDocument/hover(42)
root ERROR C/C++: I[13:35:23.206] --> reply:textDocument/hover(42) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:23.597] <-- textDocument/definition(43)
root ERROR C/C++: I[13:35:23.597] --> reply:textDocument/definition(43) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:23.844] <-- textDocument/documentHighlight(44)
I[13:35:23.844] --> reply:textDocument/documentHighlight(44) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:23.851] <-- textDocument/definition(45)
I[13:35:23.851] --> reply:textDocument/definition(45) 0 ms, error: invalid AST
root ERROR C/C++: I[13:35:24.095] <-- textDocument/codeAction(46)
root ERROR C/C++: I[13:35:24.095] --> reply:textDocument/codeAction(46) 0 ms, error: invalid AST
kittaakos commented 4 years ago

It seems if we do not include the VS Code built-in extension for C++ we do not have coloring. If we include it and we have the @theia/cpp extension as a dependency, the LS does not work.

mink99 commented 3 years ago

It is the missing configuration file (https://clangd.llvm.org/config.html ) for clangd that creates this behaviour. This file would include the path for the libraries used. I would recommend the following fix: When a project is created or saved in a certain location, created or updated a .clangd configuration file is created or updated in that directory, that contains the included library path, the same as the compilation include path. ... you may even create a user configuration file that contains the user library path, but this may interfere with other ide that are using clangd too.

mink99 commented 3 years ago

Btw, this would also fix the formatting configuration missing features.....

quiknick commented 1 year ago

Why is this issue still open after 3 years? It is clearly defined as an issue, and understood what the root cause is.