Open Declaration

Is there a way to RMB a function, select Open Declaration, and the declaration of the function appears? I am using IDE 2.1.0

Have you tried the right mouse button on a function ?

Rand Merchant Bank ?

1 Like

This is what shows up.

image

"Right mouse button" (AKA "right click").

Hi @greg2835. What do you have selected from the Tools > Board menu in Arduino IDE?

Hi @ptillisch, I have selected Arduino Uno on COM7 as shown below.

When I do a Ctrl-Click (Mac equivalent of Right Mouse Button) on the function name, the first item in the pop-up menu is "Go to Definition". I'm using IDE 2.1.0

Windows 11 IDE 2.1 will go to the built-in definition with CTRL-click on a sketch function.

Of it wasn't for @UKHeliBob's reply, I would probably not have figured it out before you posted.

Thanks everyone. A colleague has Windows 11 and it seems to work on his fine. It would be nice to use the Arduino IDE, but if anyone has suggestions for other IDEs (I am not very Arduino experienced) maybe I'll migrate to one of those.

Which operating system are you using?

My bad forgot, Windows 10

Windows 10 is definitely supported so that is not the cause of the missing "Go to Definition" feature in your IDE.

I'm going to ask you to provide the debug logs that are produced by the "Arduino Language Server" tool used by Arduino IDE for these "context-aware" features.


:exclamation: NOTE: These instructions will not solve the problem. They are only intended to gather more information which might provide a clue that eventually leads to a solution.


Please follow these instructions:

A. Enable Language Server Logging

  1. Use the Ctrl/+Shift+P keyboard shortcut to open the "Command Palette" in Arduino IDE.
  2. Select the "Preferences: Open Settings (UI)" command from the "Command Palette".
    The "Preferences" tab will now open in the editor panel.
  3. In the "Search Settings" field, type arduino.language.log
  4. Under the "Arduino > Language: Log", section, check the box next to "☐ True if the Arduino Language Server should generate log files into the sketch folder. Otherwise, false. It's false by default."
  5. Close the Preferences tab by clicking its X icon.

B. Gather Logs

  1. Select File > New Sketch from the Arduino IDE menus.
  2. Select Sketch > Show Sketch Folder from the Arduino IDE menus.
    The folder containing the sketch will open in your file browser.
  3. ZIP the entire sketch folder.
    • Instructions for Windows:
      1. Right click the sketch folder.
      2. From the context menu that opens, select "Send to".
      3. Select "Compressed (zipped) folder" from the "Send to" menu.
    • Instructions for Linux:
      1. Right click the sketch folder.
      2. From the context menu that opens, select "Compress...".
      3. In the "Create Archive" dialog that opens, click the Create button.
    • Instructions for macOS:
      1. Control-click the sketch folder.
      2. From the shortcut menu that opens, select "Compress"
  4. Attach the "ZIP" file that was created to a reply here on this forum thread.
    You can do this by drag and dropping the file onto a reply, copy/pasting the file, or by clicking the upward pointing arrow icon ("Upload") on the post composer toolbar.
  5. Close the Preferences tab by clicking its X icon.

C. Disable Language Server Logging

When language server logging is enabled, log files are saved to every sketch you open in Arduino IDE and they steadily grow in size whenever you are editing the sketch. So the logging is something you would usually want to disable whenever generation of logs is not needed.

  1. Use the Ctrl/+Shift+P keyboard shortcut to open the "Command Palette" in Arduino IDE.
  2. Select the "Preferences: Open Settings (UI)" command from the "Command Palette".
    The "Preferences" tab will now open in the editor panel.
  3. In the "Search Settings" field, type arduino.language.log
  4. Under the "Arduino > Language: Log", section, uncheck the box next to " True if the Arduino Language Server should generate log files into the sketch folder. Otherwise, false. It's false by default."
  5. Close the Preferences tab by clicking its X icon.

Please let me know if you have any questions or problems while following those instructions.

It works OK on Windows 10 here

Thanks @ptillisch and will do. I'm wrapping up things for the day but will reply back once ready.

Hey @ptillisch thanks for your patience. I followed your instructions and uploaded the zip file here. Let me know if I can help further.

sketch_may17a.zip (16.1 KB)

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