arduino-ide icon indicating copy to clipboard operation
arduino-ide copied to clipboard

[WIP] Add opened examples to Open Recent menu

Open francescospissu opened this issue 2 years ago • 0 comments

Motivation

Currently when an example sketch is opened it is not added to the Open Recent menu.

Change description

A temporary sketch can be added to the Open Recent menu if it doesn't include the string sketch_ in the name.

Other information

Closes #935.

Different solutions have been investigated to solve this problem, including:

  • Remove the return if a sketch is temporary in the markAsRecentlyOpened function https://github.com/arduino/arduino-ide/blob/5cb9166c839e7b7be19502bf28b45852127e84e4/arduino-ide-extension/src/node/sketches-service-impl.ts#L280-L281 Solution discarded because in this way also a new sketch created from File -> New is added to the recents.

  • Change the parentPath of the new opened example without the creation of a temporary folder in the cloneExample function https://github.com/arduino/arduino-ide/blob/5cb9166c839e7b7be19502bf28b45852127e84e4/arduino-ide-extension/src/node/sketches-service-impl.ts#L339 Solution discarded because the example is added directly to the sketchbook without saving it previously.

The current solution is not yet valid because a better way must be found to prevent an example from being considered a "standard" temporary file.

Reviewer checklist

  • [ ] PR addresses a single concern.
  • [ ] The PR has no duplicates (please search among the Pull Requests before creating one)
  • [ ] PR title and description are properly filled.
  • [ ] Docs have been added / updated (for bug fixes / features)

francescospissu avatar Aug 31 '22 10:08 francescospissu