-
-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Language Server (autocomplete) not using menu settings #1029
Comments
I can see the problem here in the language server logs:
The IDE is not passing the full FQBN via the |
restart the LS when board settings of the running LS has changed Closes #1029 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
restart the LS when board settings of the running LS has changed Closes #1029 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
restart the LS when board settings of the running LS has changed Closes #1029 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
restart the LS when board settings of the running LS has changed Closes #1029 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Describe the problem
The autocomplete and variable info popups find info corresponding to the Tools menu configuration options at their defaults, even when the user has changed them to a different configuration. The tools menu config can cause the build process to use a different set of defines, changing which code is actually compiled. The IDE should cause the language server to always operate with settings from the currently selected menu config, but today it appears to be always using the menu defaults regardless of what has actually been selected in those menus.
To reproduce
Using Arduino IDE 2.0.0-rc7.
1: add https://www.pjrc.com/teensy/td_156/package_teensy_index.json to additional board manager URLs in File > Preferences
2: in boards manager, search for "teensy" and install Teensy package 1.56.1
3: set the current board to Tools > Board > Teensy > Teensy 4.1
4: open or type any program with Serial, such as
5: hover your mouse over "Serial". A popup will appear telling you the type is "class usb_serial_class".
6: click Tools > USB Type and change the configuration to "RawHID"
7: again hover your mouse over "Serial". The popup will reappear, incorrectly telling you the type is still "class usb_serial_class".
8: right click Serial and select "Go To Definition". A new tab will open, showing the wrong definition which is not compiled cause CDC_DATA_INTERFACE and CDC_STATUS_INTERFACE are not defined when USB Type RawHID is selected.
Expected behavior
When USB Type is set to RawHID, the Serial object is defined as "usb_seremu_class Serial" at line 75 in usb_inst.cpp.
Changing the menu configuration alters the compiler build flags, causing completely different code to be compiled. The IDE should always configure the Language Server with the defines or other build flags from the menu configuration.
Arduino IDE version
2.0.0-rc7
Operating system
Linux
Operating system version
Ubuntu 20.04
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: