Skip to content

Commit c5efd3e

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 c5efd3e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ls/builder.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@ func (ls *INOLanguageServer) generateBuildEnvironment(ctx context.Context, fullB
186186
ls.readLock(logger, false)
187187
sketchRoot := ls.sketchRoot
188188
config := ls.config
189+
190+
// Validate FQBN before attempting compilation
191+
if config.Fqbn == "" {
192+
ls.readUnlock(logger)
193+
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")
194+
}
189195
type overridesFile struct {
190196
Overrides map[string]string `json:"overrides"`
191197
}

0 commit comments

Comments
 (0)