Description
Describe the problem
Arduino sketches may contain additional code files under the src
subfolder. This folder is included in the build and source files it contains are recursively compiled.
The Arduino IDE's language server-based features include "Go to definition" and "Peek", which reveal the definition of a code component. This works even for definitions in files not currently open in the IDE, such as libraries.
🐛 The "goto" features do not work for code components from files under the src
subfolder of the sketch.
To reproduce
- Download and open this sketch in Arduino IDE:
HasSrc.zip - Select Tools > Board > Arduino AVR Boards > Arduino Uno from the Arduino IDE menus.
- Right click on
foo.h
in this line:#include "src/foo.h"
- Select "Go to Definition" from the context menu.
🐛 Thesrc/foo.h
file does not open in an editor tab. - Right click on
foo.h
again. - Select "Peek" from the context menu.
- Select "Peek Definition" from the submenu.
🐛 Thesrc/foo.h
file does not open in an editor peek.
Expected behavior
The same behavior from the "goto" features when used on code components from the src
subfolder of the sketch as from files from any other location.
Arduino IDE version
Original report
2.0.0-rc3
Last verified with
Operating system
Windows
Operating system version
11
Additional context
Language server logs: HasSrc-logs.zip
I notice that the "goto" attempts trigger the creation of a new Arduino Language Server temporary folder, which breaks the URIs I see for src/foo.h
in the language server logs (e.g., file:///C:/Users/per/AppData/Local/Temp/arduino-language-server410042786/sketch/src/foo.h
).