Open drf5n opened 1 year ago
thank you, @drf5n this is some of that good old legacy coming from the Processing days.
Your proposal is interesting, especially from the point of view of someone who only accepts YYYYMMDDHHMMss formats for their files 🤣
I would expect auto-generated sketch names to be created with an ISO-9660-ish name and sort in a sane, chronological order.
Hi, thanks for sharing your idea. Nice one!
@drf5n, would you be interested in contributing to this feature to IDE2? I am happy to guide you, or you can reference a very much related external contribution to change the default .ino
file content with an advanced setting: https://github.com/arduino/arduino-ide/pull/1559/
A few remarks:
Alternatively, IDE2 can provide a set of predefined date formats (as an enum preference type) if such flexibility is not required.
@kittaakos -- I'm uncomfortable programming in .ts or how to modify the UI for advanced settings. Advanced settings seems impenetrable.
Regarding the example of the default.ino file, on my Mac, discovering the default sketch setting doesn't seem accessible through either "Arduino IDE/Preferences" or "Arduino IDE/Advanced":
I can't grab a screenshot of it, but normal Mac apps use the option key to expose the more advanced alternative options. In this case, the option key changes the "Arduino IDE" menu to add an alternate Quit option: Option-Command-Q offers to "Quit and Keep Windows" I'd expect that Option-Command-,
should be an enhancements of the Command-,
Preferences/settings command to show the enhanced/advanced settings.
Thanks for looking at the code, @drf5n. We will handle it later, then.
comfortable programming in .ts or how to modify the UI for advanced settings.
You don't need to change the UI at all. That's why I have referenced the other PR. Please see this comment:
I don't feel comfortable making change to the UI.
You do not have to. Checking your changeset, I am positive you can do it. Here are a few pointers:
Describe the problem
The default sketch name template of 'sketch_MMMDDx.ino' produces names that do not sort in a sane order.
January sorts after February, April comes first, and December comes second.
Using a pattern like
sketch_YYYYMMDDx
would produce names which sort in a sane order.To reproduce
Produce sketches with default names over the course of a year or multiple years.
Expected behavior
I would expect auto-generated sketch names to be created with an ISO-9660-ish name and sort in a sane, chronological order.
Either include the year and numeric month, or if awkward names that encourage renaming are the goal, use a simpler scheme like
sketch_xxxx
.Arduino IDE version
2.1.0
Operating system
macOS
Operating system version
13.2.1
Additional context
Per @ptillisch, the code is here:
https://github.com/arduino/arduino-ide/blob/31deeebb4970b4de9925161c291084d8d5f8273d/arduino-ide-extension/src/node/sketches-service-impl.ts#L372-L415
I'm not sure how that code pads the day numbers with zeros, but maybe something like this would work as I expect it should:
Issue checklist