Skip to content
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

[Navigation] - When navigating to Library Inner Class/Interface it won't sync Java projects View #833

Open
mamilic opened this issue May 6, 2024 · 2 comments · May be fixed by eclipse-jdtls/eclipse.jdt.ls#3152
Labels
bug Something isn't working

Comments

@mamilic
Copy link
Contributor

mamilic commented May 6, 2024

Type: Bug

Steps:

  1. Clone this project https://github.com/nipafx/nox.zone
  2. Navigate to JDK StringTemplate.class
  3. Go to 447 line of code, Processor<StringTemplate, RuntimeException> RAW = st -> st;
  4. 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
@jdneo
Copy link
Member

jdneo commented May 7, 2024

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.

@rgrunber
Copy link

Some possible limitations with classes containing '$' in the name : eclipse-jdt/eclipse.jdt.core#2441 to be aware of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants