Skip to content

Commit 6a51e4e

Browse files
committed
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).
1 parent 49425d7 commit 6a51e4e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ls/builder.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"context"
2121
"fmt"
2222
"io"
23+
"log"
2324
"strings"
2425
"sync"
2526
"time"
@@ -186,6 +187,12 @@ func (ls *INOLanguageServer) generateBuildEnvironment(ctx context.Context, fullB
186187
ls.readLock(logger, false)
187188
sketchRoot := ls.sketchRoot
188189
config := ls.config
190+
191+
// Validate FQBN before attempting compilation
192+
if config.Fqbn == "" {
193+
ls.readUnlock(logger)
194+
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")
195+
}
189196
type overridesFile struct {
190197
Overrides map[string]string `json:"overrides"`
191198
}

0 commit comments

Comments
 (0)