From 6a51e4e14bdd7d1f3048eb182b9e125c5b9e3296 Mon Sep 17 00:00:00 2001 From: Michael Bacarella Date: Sat, 11 Oct 2025 10:32:17 -0700 Subject: [PATCH] Abort rather than calling arduino-cli compile with a blank --fqbn. The server calls arduino-cli compile --fqbn even if fqbn is not known, which leads to more confusing errors. Abort earlier and explain what to do (call the server with -fqbn instead). --- ls/builder.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ls/builder.go b/ls/builder.go index 1e2de81..666780f 100644 --- a/ls/builder.go +++ b/ls/builder.go @@ -20,6 +20,7 @@ import ( "context" "fmt" "io" + "log" "strings" "sync" "time" @@ -186,6 +187,12 @@ func (ls *INOLanguageServer) generateBuildEnvironment(ctx context.Context, fullB ls.readLock(logger, false) sketchRoot := ls.sketchRoot config := ls.config + + // Validate FQBN before attempting compilation + if config.Fqbn == "" { + ls.readUnlock(logger) + log.Fatal("FQBN (Fully Qualified Board Name) is required but not specified. Please restart the language server with the -fqbn flag or set default_fqbn in sketch.yaml") + } type overridesFile struct { Overrides map[string]string `json:"overrides"` }