How to clear "recent files" list in 2.0

I want the IDE to forget any files it thinks were loaded already so that it does the first time processing and opens each file one at a time again. Where can I clear this out?

Can you be clearer in your requirement? I assume that this relates to 2.0 very slow load time with many sketch files (logs included for the devs).

My observation is that the IDE will go through all files that it finds in the sketchbook directory. If you clean that out (meaning, move non-used projects to something like "oldSketchbook"), it might speed up the loading process.

On a Windows system, the following directories and files are generated by IDE 2.0; the IDE seems quite bad in cleaning it up (or maybe my antivirus blocks a complete cleanup). I do not know if cleaning it out will improve the loading of the IDE / your project but you can try. Note that the list is not necessarily complete.

C:\Users\yourUsername\AppData\Local\Temp

  1. directories starting with .arduinoIDE-unsaved
  2. directories with numeric names like 5577006791947779410392547560 containing the files
    index.gz
    index.json
    index.json.sig
    This excludes directories with names like 25491F55-F836-4B0A-ADB0-D4F7BAFB61FB
  3. directories starting with arduino-ide
  4. directories starting with arduino-language-server
  5. directories starting with arduino-sketch
  6. files starting with system-includes and the extension clangd, e.g. system-includes-2f0e9a.clangd
  7. log files starting with dd_updateconfiguration

C:\Users\yourUsername\.arduinoIDE\logs
[/quote]

If you close each sketch individually before closing down the IDE rather than using File/Quit with multiple sketches open then only the last open sketch opens when you restart the IDE

1 Like

Sorry, what I meant was, that in testing, I only get one chance to open a sketch with multiple files. I assumed it remembers files it has already loaded in a settings file. I want to have it "forget" that it ever opened a sketch so that it loads all the files again.

This IS related to my other post about slow load times, but indirectly. Since that has 50+ files, it takes longer the FIRST time I load it. But then it remembers I loaded it and only takes 30 seconds on subsequent loads. So I am trying to get it to do what it does on first open so I can generate a log.

OMG on the list of files I have to look for. If I go through the trouble of a portable install (I did that for the 1.8.x version because 2.0 compiles our code differently), will it make sure that neither version writes anything anywhere other than its folder and the "portable" folder inside it? I guess I will do a complete uninstall. I'm not sure what settings from the older, non-portable, install I did a long time ago that the 2.0 version picked up, but I imagine nothing that couldn't easily be added back.

I assume that you meant "chance" but, that aside, I still don't get what is happening and what it is that you want to happen

When you refer to "a sketch with multiple files" what exactly does that mean ? What type of files and where are they located ?

@fdecker

I don't know the specific file or files where this "workspace" information is stored for each of the sketches you have opened. However, I can tell you the location of the folder where it is stored:

Windows

%APPDATA%\arduino-ide\

(e.g., C:\Users\<user name>\AppData\Roaming\arduino-ide\)

Linux

~/.config/arduino-ide/

macOS

~/Library/Application Support/arduino-ide/

In the jargon of the VS Code/Eclipse Theia framework the IDE is built on, this is called the "user data" folder. I often delete the user data folder entirely when I want to effectively simulate a fresh install (removal of other folders is necessary to fully simulate that, but often deletion of this folder alone is sufficient for my purposes). You can safely delete the entire folder, so don't worry about finding the specific files you need.

Unfortunately Arduino IDE 2.x doesn't currently have a portable mode like Arduino IDE 1.x does. This deficiency is being tracked by the IDE developers here:

1 Like

I have over 50 .cpp and .h files in our sketch. The very first time I open it on v2.0, something happens in the background and each file takes over 5 seconds each to load and I can see them slowly populating on tabs at the top. The total load time is over 6 minutes (much, much longer on older machines and for a team member who uses Linux instead of Windows). A startup log shows 50+ lines like this:

root WARN Timeout after 5000 millis. The editor has not shown up in time. URI: file:///c%3A/temp/myFolder/myFile.h

So right there, the "editor" is causing me 5 seconds delay on every file in the sketch.

BUT, every time I load that sketch again after the first time, it does not do that. There are no such messages in the log and it loads much faster. Still too slow, but much faster. So clearly, it is storing some number of previously opened sketches somewhere and going through a different process when it loads a previously loaded sketch.

With the previously loaded sketch, I see a blank window for 30 or 40 seconds and then it finally opens with all the tabs for all the files already loaded. Why does it have this behavior and where does it store whatever it is storing to know that sketch is already load and to not do this slower process? I was assuming that there is a table of X number of previously loaded sketches, and if it sees one of those, it bypasses some check and just loads the names of all the files into the IDE. I want to be able to clear this "cache" so that I can easily be able to generate that kind of log for the developers.

I imagine there are not a lot of people testing 2.0 with over 50 C++ files. If you want to look at the repo to see all the files if that helps you, it is here: GitHub - DCC-EX/CommandStation-EX: EX-CommandStation firmware from DCC-EX. Includes support for WiFi and a standalone WiThrottle server. A complete re-write of the original DCC++.. It is a very popular free and open source software to control model railroad trains and layouts. Most of our developer team actually use Platform IO in Visual Studio to code it, but most of the thousands of users has to use this IDE to compile and upload the project to their microcontroller. The ones who don't, use our installer which runs the arduino-cli as one step in the process.

1 Like

Thanks for the explanation of the problem. It would have helped to have the detail earlier bearing in mind that I have not read your other related topic until I just went looking for it

I thought "how to clear recent file list in 2.0?" along with my extra detail was pretty clear. It did not require having to look at a previous post on a different subject.

I just wanted to know where the IDE stores its recent file list that displays on the file menu. I program in Delphi, C++, and VB.Net - "Electron" and "Theia" is completely foreign to me at this point. I went through the source code as best I could by searching for keywords, and while I have no idea of the structure of the program or how to follow it, I was able to see that it uses a "hash" to find the files it has loaded before. So part of the answer is that for Windows, there is a "recent-sketches.json" and a "recentworkspace.json" in the \users<user name>.arduinoIDE folder. Opening them in a text editor, you can modify them. Here is the contents of my recent-sketches.json

  "file:///c%3A/Users/Fred/Documents/Arduino/CommandStation-EX": 1667143438694,
  "file:///c%3A/Users/Fred/Documents/Arduino/WifiTest/WifiTestUno": 1667153316590,
  "file:///c%3A/Users/Fred/Documents/PlatformIO/Projects/CommandStation-EX": 1667153230422,
  "file:///c%3A/temp/CommandStation-EX": 1667148777453
}```

The routine, this.sketchService.loadSketch, called in the workspace-service.ts file seems to be a start. I delete those files, and they do get updated, but there is still a file somewhere else that remembers the last file I opened.

This is something I've never figured out. Everything else resets when I delete the "user data" folder and the "configuration" folder (e.g., C:\Users\<username>\.arduinoIDE\), but it still loads the last sketch.

I haven't yet found the inability to clear this specific thing to be a problem for my work so I didn't put much effort towards investigating it, but it does bother me a bit that I don't know where it is stored.

Based on your post above with folders, I found this in the %APPDATA%\arduino-ide\config.json file:

{
	"windowstate": {
		"isFullScreen": false,
		"isMaximized": false,
		"width": 1024,
		"height": 576,
		"x": 256,
		"y": 144,
		"frame": true,
		"screenLayout": "0:0:1536:864"
	},
	"workspaces": [
		{
			"x": 256,
			"y": 144,
			"width": 1024,
			"height": 576,
			"isMaximized": false,
			"isFullScreen": false,
			"file": "c:\\Users\\Fred\\Documents\\Arduino\\Blank",
			"time": 1667392172587
		}
	]
}```

And there are also these files in the \users\Fred\.arduinoIDE folder

recent-sketches.json
recentworkspace.json

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.