Is it normal that sometimes if an error happens in the upload phase (or even similar situations) the autocomplete feature stop working?
I'm using the latest version of the IDE as of now (2.3.2), and the board (even tho I don't think is relevant) is the ESP32 Wrover. Regarding the OS I am using windows 11 but I've troubles like that even on MacOS
There are some conditions under which the autocomplete feature will either be unavailable or missing expected items:
If you don't have a board selected from the Tools > Board menu it will be unavailable.
If you have boards of certain unsupported architectures (e.g., Nano Every) it will be unavailable.
If you have not compiled a sketch since the time a library was added, the symbols provided by the library will be missing.
There are a few other niche causes, but I can't think of how a failed upload would cause any of them. I just tried reproducing it by causing an upload to fail while I had the "ESP32 Wrover Module" board selected in Arduino IDE and the autocomplete continued to work even after.
Are you able to reproduce the bug on demand? If so, please provide the full output from the failed upload. Maybe that information will allow me to understand the problem better.
Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open.
Uncheck the box next to Show verbose output during: ☑ compilation in the "Preferences" dialog.
Check the box next to Show verbose output during: ☐ upload.
Click the "OK" button.
Produce a upload error, as you did before.
Wait for the upload to fail.
Verify that autocomplete is no longer working.
You will see a "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
Open a forum reply here by clicking the "Reply" button.
Click the <CODE/> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
This will paste the error output from the upload into the code block.
Move the cursor outside of the code block markup before you add any additional text to your reply.
I didn't specify it before but I had already selected the board and the correct port. Moreover the sketch was saved into a a file (since I heard that some people had issues since the sketch was not saved on the PC). Now I tried again and it worked like a charm even after I uploaded the sketch containing errors. Indeed sometimes it works and sometimes not but it is not a real issue (at least for me), since in case it happens you just need to close and open again the IDE.