Skip to content

Commit

Permalink
no-merge: added a preference to reproduce #1791
Browse files Browse the repository at this point in the history
the smaller the timeout the better chance you have to see the duplicate editors.

Signed-off-by: Akos Kitta <[email protected]>
  • Loading branch information
Akos Kitta committed Mar 20, 2023
1 parent 9b49712 commit bd8e66d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions arduino-ide-extension/src/browser/arduino-preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ export const ArduinoConfigSchema: PreferenceSchema = {
),
default: undefined,
},
'arduino.sketch.editorOpenTimeout': {
type: 'number',
description:
'Set the editor timeout in milliseconds to reproduce the duplicate editor tabs. See #1791',
default: 5000,
},
},
};

Expand Down Expand Up @@ -288,6 +294,7 @@ export interface ArduinoConfiguration {
'arduino.cli.daemon.debug': boolean;
'arduino.sketch.inoBlueprint': string;
'arduino.checkForUpdates': boolean;
'arduino.sketch.editorOpenTimeout': number;
}

export const ArduinoPreferences = Symbol('ArduinoPreferences');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export class OpenSketchFiles extends SketchContribution {
}
});

const timeout = 5_000; // number of ms IDE2 waits for the editor to show up in the UI
const timeout = this.preferences['arduino.sketch.editorOpenTimeout']; // number of ms IDE2 waits for the editor to show up in the UI
const result: EditorWidget | undefined | 'timeout' = await Promise.race([
deferred.promise,
wait(timeout).then(() => {
Expand Down

0 comments on commit bd8e66d

Please sign in to comment.