Skip to content

Commit bd8e66d

Browse files
author
Akos Kitta
committed
no-merge: added a preference to reproduce #1791
the smaller the timeout the better chance you have to see the duplicate editors. Signed-off-by: Akos Kitta <[email protected]>
1 parent 9b49712 commit bd8e66d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

arduino-ide-extension/src/browser/arduino-preferences.ts

+7
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ export const ArduinoConfigSchema: PreferenceSchema = {
258258
),
259259
default: undefined,
260260
},
261+
'arduino.sketch.editorOpenTimeout': {
262+
type: 'number',
263+
description:
264+
'Set the editor timeout in milliseconds to reproduce the duplicate editor tabs. See #1791',
265+
default: 5000,
266+
},
261267
},
262268
};
263269

@@ -288,6 +294,7 @@ export interface ArduinoConfiguration {
288294
'arduino.cli.daemon.debug': boolean;
289295
'arduino.sketch.inoBlueprint': string;
290296
'arduino.checkForUpdates': boolean;
297+
'arduino.sketch.editorOpenTimeout': number;
291298
}
292299

293300
export const ArduinoPreferences = Symbol('ArduinoPreferences');

arduino-ide-extension/src/browser/contributions/open-sketch-files.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export class OpenSketchFiles extends SketchContribution {
196196
}
197197
});
198198

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

0 commit comments

Comments
 (0)