Data item properties in IDE 2.1

I loved the ability to place the cursor over a variable or symbolic constant and see its attribute list. I upgraded from 2.0.4 to 2.1 and I can't seem to get that to work. What am I doing wrong?

Hi @econjack. Do you mean this "Editor Hover" feature?:

image

Which board do you have selected from the Tools > Board menu in Arduino IDE?

I ask because the "language server"-based feature like "Editor Hover" are dependent on the board selection. There are a few boards that aren't supported and it is also possible to have no board at all selected. Under either of these conditions, the language server-based features are unavailable..

Yes. I am using the Teensy 4.1 board. That feature worked with release 2.0.4 and the Teensy 4.1, but not now. That's an incredibly useful feature as I use a boatload of symbolic constants that I can never remember. For what it's worth, it might be useful to place the "Hover" dialog box in the upper-right corner of the source window, as sometimes it covers up the exact spot I'm trying to read.

EDIT: The F12 key, which allows you to highlight a function name, press F12, and the IDE takes you to the function definition code, does not work either. Both of these worked for the Teensy 4.1 board with release 2.0.4.

Please tell me which version of the Teensy boards platform you have installed. You can see the version in the Arduino IDE Boards Manager.

Please tell me what you have selected from the following Tools menu submenus:

  • Keyboard Layout
  • Optimize
  • CPU Speed
  • USB Type

Teensy board installed: 1.58.1

All tools are default and not changed by me

Keyboard Layout: US English
Optimize: Faster
CPU Speed: 600MHz
USB Type: Serial

Thanks for the information. I am not able to reproduce the problem even with the identical configuration on my computer.

In order to continue with the investigation, I'm going to ask you to provide the logs that are generated by the language server when processing a sketch:

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.

Gather Logs

  1. Select File > New Sketch from the Arduino IDE menus.
  2. Select Tools > Board > Teensy > Teensy 4.1 from the Arduino IDE menus.
  3. Select Sketch > Show Sketch Folder from the Arduino IDE menus.
    The folder containing the sketch will open in your file browser.
  4. 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"
  5. 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.
  6. Close the Preferences tab by clicking its X icon.

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.

It should be here:

sketch_apr23b.zip (26.1 KB)

Thanks for all your effort on my behalf.

I just plugged in a Nano and tried the Hover and F12 keys...both worked with release 2.1 so it would appear that the error is in the Teensy patch code.

@ptillisch and @econjack I have also posted a little over on the pjrc forum thread:
Issues with Arduino IDE 2.1 and Teensy 4.1 (pjrc.com)

With one sketch I had opened it worked fine to get the hover stuff, but with some others it did not appear to work.

Like for example this one: KurtE/mtp_tft_picture_view: WIP (github.com)

But it has some interesting challenges, like it starts off with:

// Also allow this sketch to work regardless if we decide to use MTP or not
#if defined(USB_MTPDISK) || defined(USB_MTPDISK_SERIAL)
// If user selected a USB type that includes MTP, then set it up
#include <MTP_Teensy.h>
#endif

So it only includes MTP if the USB type is: MTP or Serial + MTP.

Then it can include one of several TFT drivers header files:

// If using the Sparkfun IO Carrier board uncomment this line and
// and using one of the ILI9341 libraries
//#define USE_SF_IOCarrier 1

// optional support for ILI9341_t3n - that adds additional features
//#include <ILI9341_t3n.h>

// optional support for ILI9488_t3 - that adds additional features
//#include <ILI9488_t3.h>

//Optional support for ST7735/ST7789 graphic dislplays
//#include <ST7735_t3.h> // Hardware-specific library
//#include <ST7789_t3.h> // Hardware-specific library
//#define USE_KURTE_MMOD1
#define USE_KURTE_MMOD2

//Optional support for RA8875
//#include <RA8875.h>

//Optional support for RA8876
#define USE_KURTS_2ND_BOARD
//#include <FT5206.h>
#include <RA8876_t3.h>

Currently it has installed RA8876_t3.h
And by it knowing which defines are generated by the include it then defines the tft object...
In this case:

// RA8876 capacitive IRQ
#if defined(_RA8876_T3)
#if defined(USE_KURTS_2ND_BOARD)
#undef TFT_DC
#undef TFT_CS
#undef TFT_RST
//#define TFT_DC 30
#define TFT_CS 30
#define TFT_RST 28
#define TFT_BL 29
#define RA8876_INT 31
#define RA8876_CTPRST 32
#else
#undef TFT_RST
#define TFT_RST 9

#define RA8876_INT 6
#define RA8876_CTPRST 31
#endif
#define MAXTOUCHLIMIT 1  //1...5

RA8876_t3 tft = RA8876_t3(TFT_CS, TFT_RST);
#pragma message "Display: RA8876_t3"
#endif

And for example in this case
image
The hover's are not working at all...

But this is probably too much of a stress test.

The fact that it works with the Nano and not the Teensy makes me think they changed something that the Teensyduino 1.58 is not aware of.

But as I showed up on the PJRC forum, this works some of the time, like with this other window and sketch:

But with the one that I mentioned did not work, I setup to capture the log files..

mtp_tft_picture_view.zip (189.4 KB)

I had it configured for Teensy 4.1
USB Type: Serial + MTP Disk.
Running yesterdays nightly build
Teensyduino 1.58.1

Thanks. I see the problem here:

15:38:15.387049 e[96mINIT --- : error starting clang: error running compile: rpc error: code = NotFound desc = Cannot find build path: Rel: can't make C:\Users\kurte\AppData\Local\Temp\arduino-language-server607182791 relative to D:\github\mtp_tft_picture_viewe[0m
15:38:15.387049 e[92m                 textDocument/didOpen: e[93mlocked (waiting clangd)e[0me[0m
15:38:15.387049 e[92m                 textDocument/didOpen: clangd startup failed: quitting Language servere[0m

I investigated and found there was a regression in the recent 0.32.0 release of Arduino CLI. This caused a regression in Arduino IDE 2.1.0 because the Arduino CLI dependency of the IDE was updated from the functional 0.31.0 version to the 0.32.2 version that has this regression.

I submitted a report to the Arduino CLI developers:

This fault only occurs when the sketch is on a different drive from your system's temporary folder (which is on C:\ for both of you).

If this is the sole cause of the language server problems you experienced, we would expect the problems to not occur when you are working with a sketch that is saved somewhere on your C:\ drive. @econjack @KurtE please try saving your sketch to any convenient location on the C:\ drive your your computer and then tell me whether the problem still occurs in that sketch.

1 Like

@ptillisch: I moved my source code to my C: drive and both Hover and F12 are fully functional. Again, thank you for your help on my behalf.
@kurtE: Thanks, Kurt, for providing the details that helped ptillisch find a solution

You are welcome. I'm glad we at least have a known workaround now to mitigate the impact of the bug.

Thanks also to you for bringing this to our attention.

Regards,
Per

1 Like

@ptillisch I thought I would mention that this is probably specific to Windows machines as Paul @pjrc mentioned on the PJRC forum that his temp directory is physically on a different volume...

you need to physically move the sketch to the same drive as where %temp% is stored. On my machine c:

That is: with my mtp_tft_picture_view example, doing a copy of this directory to my Arduino directory on c: (c:\users\kurte\documents\arduino) it works.

But doing something like:

cd c:\users\kurte\documents\arduino
mklink /J mtp_tft_picture_view   d:\github\mtp_tft_picture_view

And then opening the sketch from that logical directory on my C: drive does not work. That is because Arduino code for whatever reason decided to dereference the links. So, I you use the Sketch->Show Sketch folder menu item it will show it on the D: drive and the

But it could just as easily have left it with the actual path I used to open it. Both are valid as you can see in the picture:

I posted elsewhere that once I was able to use the Hover and F12 features, I was unable to set the port for the Teensy; it was always greyed out. The Device Manager said all my ports were okay. They seemed dead to me, so I put in a new expansion card with 4 ports on it. I compiled the ASCII table example just to confirm the Serial object was working...it was. I then loaded my SDR project, compiled it, and got:

*internal error in mingw32_gt_pch_use_address, at config/i386/host-mingw32.c:192: MapViewOfFileEx: Attempt to access invalid address. *

exit status 1

Compilation error: exit status 1

Like I said over on the Teensy Forum, I think someone is telling me to take up fishing again.

Could also be the universe trying to subtly suggest upgrading from Microsoft Windows to Linux or MacOS...

Most likely a wise move, but two problems: 1) really old dog, and 2) my writing/consulting is all Windows-based. I used Unix for a while about 30 years ago, but remember virtually none of it.

For me the universe told me to not downgrade to use Ubuntu as I have to reinstall it, when things like dependencies get screwed up... And I have not had to reinstall Windows for many years now! :wink:

As I mentioned on the PJRC forum post, I would try to clear out a bunch of the current cache of stuff. i.e. clear out stuff out of your %temp% directory.
Starting with the arduino subdirectory where it tries to cache the results of previous builds.

My guess from the message it was probably trying to use a previously generated pch (pre compiled header), which was not right...

Jack: The last time I got a "mingw" error message I fixed it by emptying the contents of my "temp" folder (users/myname/appdata/local/temp). I have no knowledge of the internals, but when there are many files in temp stuff breaks.

  • Wes