mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-08 18:08:33 +00:00
feat: new window inherits the custom board options
A new startup task ensures setting any custom board menu selection in a new sketch window. Closes #2271 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
@@ -35,7 +35,7 @@ export class BoardsDataMenuUpdater extends Contribution {
|
||||
private readonly toDisposeOnBoardChange = new DisposableCollection();
|
||||
|
||||
override onStart(): void {
|
||||
this.boardsDataStore.onChanged(() =>
|
||||
this.boardsDataStore.onDidChange(() =>
|
||||
this.updateMenuActions(
|
||||
this.boardsServiceProvider.boardsConfig.selectedBoard
|
||||
)
|
||||
|
||||
@@ -90,7 +90,7 @@ export class InoLanguage extends SketchContribution {
|
||||
this.notificationCenter.onPlatformDidInstall(() => forceRestart()),
|
||||
this.notificationCenter.onPlatformDidUninstall(() => forceRestart()),
|
||||
this.notificationCenter.onDidReinitialize(() => forceRestart()),
|
||||
this.boardDataStore.onChanged((dataChangePerFqbn) => {
|
||||
this.boardDataStore.onDidChange((event) => {
|
||||
if (this.languageServerFqbn) {
|
||||
const sanitizedFqbn = sanitizeFqbn(this.languageServerFqbn);
|
||||
if (!sanitizeFqbn) {
|
||||
@@ -98,13 +98,13 @@ export class InoLanguage extends SketchContribution {
|
||||
`Failed to sanitize the FQBN of the running language server. FQBN with the board settings was: ${this.languageServerFqbn}`
|
||||
);
|
||||
}
|
||||
const matchingFqbn = dataChangePerFqbn.find(
|
||||
(fqbn) => sanitizedFqbn === fqbn
|
||||
const matchingChange = event.changes.find(
|
||||
(change) => change.fqbn === sanitizedFqbn
|
||||
);
|
||||
const { boardsConfig } = this.boardsServiceProvider;
|
||||
if (
|
||||
matchingFqbn &&
|
||||
boardsConfig.selectedBoard?.fqbn === matchingFqbn
|
||||
matchingChange &&
|
||||
boardsConfig.selectedBoard?.fqbn === matchingChange.fqbn
|
||||
) {
|
||||
start(boardsConfig.selectedBoard);
|
||||
}
|
||||
|
||||
@@ -65,10 +65,13 @@ export class UpdateArduinoState extends SketchContribution {
|
||||
this.updateCompileSummary(args[0]);
|
||||
}
|
||||
}),
|
||||
this.boardsDataStore.onChanged((fqbn) => {
|
||||
this.boardsDataStore.onDidChange((event) => {
|
||||
const selectedFqbn =
|
||||
this.boardsServiceProvider.boardsConfig.selectedBoard?.fqbn;
|
||||
if (selectedFqbn && fqbn.includes(selectedFqbn)) {
|
||||
if (
|
||||
selectedFqbn &&
|
||||
event.changes.find((change) => change.fqbn === selectedFqbn)
|
||||
) {
|
||||
this.updateBoardDetails(selectedFqbn);
|
||||
}
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user