@@ -72,9 +72,8 @@ type InoHandler struct {
72
72
73
73
// ClangdProc contains the process input / output streams for clangd.
74
74
type ClangdProc struct {
75
- Start func () (io.WriteCloser , io.ReadCloser , io.ReadCloser )
76
- Logs * StreamLogger
77
- initParams lsp.InitializeParams
75
+ Start func () (io.WriteCloser , io.ReadCloser , io.ReadCloser )
76
+ Logs * StreamLogger
78
77
}
79
78
80
79
// FileData gathers information on a .ino source file.
@@ -174,8 +173,6 @@ func (handler *InoHandler) transformParamsToClangd(ctx context.Context, method s
174
173
}
175
174
176
175
switch method {
177
- case "initialize" :
178
- handler .clangdProc .initParams = * params .(* lsp.InitializeParams )
179
176
case "textDocument/didOpen" :
180
177
p := params .(* lsp.DidOpenTextDocumentParams )
181
178
uri = p .TextDocument .URI
@@ -353,17 +350,14 @@ func (handler *InoHandler) handleError(ctx context.Context, err error) error {
353
350
submatch := exp .FindStringSubmatch (errorStr )
354
351
message = submatch [1 ]
355
352
} else if strings .Contains (errorStr , "platform not installed" ) || strings .Contains (errorStr , "no FQBN provided" ) {
356
- var board string
357
353
if len (handler .config .SelectedBoard .Name ) > 0 {
358
- board = handler .config .SelectedBoard .Name
359
- } else {
360
- board = handler .config .SelectedBoard .Fqbn
361
- }
362
- if len (board ) > 0 {
354
+ board := handler .config .SelectedBoard .Name
363
355
message = "Editor support may be inaccurate because the core for the board `" + board + "` is not installed."
364
356
message += " Use the Boards Manager to install it."
365
357
} else {
366
- message = "Editor support may be inaccurate because the selected board is unkown."
358
+ // This case happens most often when the app is started for the first time and no
359
+ // board is selected yet. Don't bother the user with an error then.
360
+ return err
367
361
}
368
362
} else if strings .Contains (errorStr , "No such file or directory" ) {
369
363
exp , regexpErr := regexp .Compile ("([\\ w\\ .\\ -]+)\\ .h: No such file or directory" )
0 commit comments