I've noticed an interesting issue with the 2.0 IDE. I don't know if this is bug or feature, but I thought I'd mention it. Let's get this part out of the way, It's 2.2.1 on Ubuntu 22.04 using the App Image. I haven't updated it in a while so it might be a little out of date.
I didn't notice the issue until I turned autosave off. If I make a change and compile without saving and have an error, the error message includes code from the old saved version.
For example, if I take the StateChangeDetection example from the IDE for the UNO and change the digitalRead to a digitalWrite at the top of loop:
Code truncated for brevity...
void loop() {
// read the pushbutton input pin:
buttonState = digitalWrite(buttonPin, HIGH); // error here
// compare the buttonState to its previous state
if (buttonState != lastButtonState) {
// if the state has changed, increment the counter
if (buttonState == HIGH) {
Then I hit the check mark to compile without saving. The error message I get is:
/home/david/Arduino/01StateChangeDetection/01StateChangeDetection.ino: In function 'void loop()':
/home/david/Arduino/01StateChangeDetection/01StateChangeDetection.ino:48:45: error: void value not ignored as it ought to be
buttonState = digitalRead(buttonPin);
It shows the old line of code that had digitalRead.
If I hit save and compile I get the same error but with the right line of code this time:
/home/david/Arduino/01StateChangeDetection/01StateChangeDetection.ino: In function 'void loop()':
/home/david/Arduino/01StateChangeDetection/01StateChangeDetection.ino:48:45: error: void value not ignored as it ought to be
buttonState = digitalWrite(buttonPin, HIGH);
Until I figured this out it led to a couple of crazy wild goose chases.