arduino / arduino-language-server

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

Unexpected error from LS when suggesting #120

Open kittaakos opened 2 years ago

kittaakos commented 2 years ago

Describe the problem

Error:

errors.ts:26 Uncaught Error: Cannot read properties of null (reading 'map')

TypeError: Cannot read properties of null (reading 'map')
    at asCompletionResult (/Users/a.kitta/dev/g…ist/bundle.js:11434)
    at errors.ts:26

To reproduce

Broken snippet:

#include <ArduinoGraphics.h>
#include <Arduino_MKRRGB.h>
#include <

void setup() {
  MATRIX.begin();

}

void loop() {
}

Then complete the < with > in the third line so you get:

#include <ArduinoGraphics.h>
#include <Arduino_MKRRGB.h>
#include <>

void setup() {
  MATRIX.begin();

}

void loop() {
}

Expected behavior

Does not throw.

Arduino Language Server version

HEAD of the main branch.

Arduino CLI version

From sources: cmaglie:skip_lib_search_result

Operating system

macOS

Operating system version

12.3.1

Additional context

No response

Issue checklist