Skip to content

Commit 8e1feb3

Browse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
Stop LS when user picks a board that has no core.
Signed-off-by: Akos Kitta <[email protected]>
1 parent cdadda8 commit 8e1feb3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,16 @@ export class ArduinoFrontendContribution implements FrontendApplicationContribut
234234
if (!details) {
235235
// Core is not installed for the selected board.
236236
console.info(`Could not start language server for ${fqbn}. The core is not installed for the board.`);
237+
if (this.languageServerFqbn) {
238+
try {
239+
await this.commandRegistry.executeCommand('arduino.languageserver.stop');
240+
console.info(`Stopped language server process for ${this.languageServerFqbn}.`);
241+
this.languageServerFqbn = undefined;
242+
} catch (e) {
243+
console.error(`Failed to start language server process for ${this.languageServerFqbn}`, e);
244+
throw e;
245+
}
246+
}
237247
return;
238248
}
239249
if (fqbn === this.languageServerFqbn) {

0 commit comments

Comments
 (0)