[Navigation] - When navigating to Library Inner Class/Interface it won't sync Java projects View
Type: Bug
Steps:
- Clone this project https://github.com/nipafx/nox.zone
- Navigate to JDK StringTemplate.class
- Go to 447 line of code, Processor<StringTemplate, RuntimeException> RAW = st -> st;
- CTRL + Left Click to naviagate to Processor interface
After navigating to Processor it will lose sync with Java Projects view, and will open a new tab with StringTemplate$Processor.class file. While it is poiting to correct line of code where Processor is located, it should not open a new tab, it should navigate to StringTemplate.class.
Extension version: 0.23.6 VS Code version: Code 1.89.0 (b58957e67ee1e712cebf466b995adf4c5307b2bd, 2024-05-01T02:08:25.066Z) OS version: Linux x64 6.8.9-zen1-1-zen Modes:
System Info
| Item | Value |
|---|---|
| CPUs | AMD Ryzen 5 PRO 4650U with Radeon Graphics (12 x 3990) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off video_decode: enabled video_encode: disabled_software vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: disabled_off |
| Load (avg) | 2, 2, 2 |
| Memory (System) | 38.55GB (22.61GB free) |
| Process Argv | |
| Screen Reader | no |
| VM | 0% |
| DESKTOP_SESSION | gnome |
| XDG_CURRENT_DESKTOP | GNOME |
| XDG_SESSION_DESKTOP | gnome |
| XDG_SESSION_TYPE | wayland |
Looks like it's something related with the upsteam JDT. Looks like it is not aware that they belong to the same source file, though the compiled class files are two different ones.
Update:
It's because in the implementation, StringTemplate and StringTemplate$Processor points to two different uris(with jdt scheme). So far there is no good way to determine whether they actually points to the same source file, since $ is a valid character for the class name as well.
One workaround I'm thinking is that when it comes to a class with name containing $, try to get the source of that class file and the source of the class file without $xxx if it's available. And compare the source to check if they come from the same source file.
Some possible limitations with classes containing '$' in the name : https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2441 to be aware of.