IDE 2.0 stuck in edit mode

Sometimes the IDE seems to be stuck in edit mode. I right click on a function and expect the menu that is topped with "go to definition" but instead I get an edit popup that starts with "Change all occurrences", "Redo", ... Recompiling and reloading have no effect, nor does closing the sketch and reopening from another sketch. The only cure I have found is to completely shut down the IDE and restart.

Is there some kind of toggle here of which I am unaware?

I have had the same problem. I simply use an external editor Geany, problem solved. I see this and other things happen when I get a lot of Java errors during compile. The only fix is to shut down sometimes all occurrences of the IDE and relaunch them. This has happened with several versions of the IDE and several different Linux operating systems. Sometimes it will lock up the system and cause cinnamon to crash. This usually happens when I make some major blunders in code "punctuation".

Is there any guidance for this setup?

Not that I'm aware of.

Please share a screenshot of the menu.

Which board do you have selected in the Arduino IDE?

Do you notice any other problems with the Arduino IDE interface when the IDE is in this state?

Which operating system are you using?

If you are getting Java errors then you must be using the Java based Arduino IDE 1.x rather than the TypeScript-based Arduino IDE 2.x. Since the GUI code of the new IDE does not use even a single line of code from the IDE 1.x code base, a bug in the IDE 1.x GUI will be unlikely to have the same cause as one in the IDE 2.x GUI, even if they resemble each other.

I'm not sure it will solve the problem reported by @boristheromanoff. The reason is that "Go to Definition" depends on the Arduino Language Server, so the only way you could get that functionality when using Geany for the editor is if you have a language server set up in Geany.

You might be able to get some level of functionality out of a standard C++ language server, but a standard C++ language server doesn't know anything about the Arduino sketch preprocessing and library discovery.

The purpose of Arduino Language Server is to act as the translator between the Arduino sketch build system and a standard C++ language server (clangd). In theory, it should be able to integrate Arduino Language Server with any IDE that understands the standard Language Server Protocol, but it is likely to be a bit of an advanced process.

If you only want to use an external editor, the only setup needed is to do this in the Arduino IDE:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Check the box next to "☐ Auto save".
  3. Click the OK button.

You can now open your sketch files in any editor and use that editor to write your sketch code. The sketch open in the Arduino IDE will reflect any changes that you have made in the external editor.

You can continue to use the Arduino IDE for compilation, uploads, Boards Manager, Library Manager, etc.

1 Like

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