redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.08k stars 441 forks source link

[Bug] - Can not find class from logs in terminal #3822

Open mamilic opened 1 month ago

mamilic commented 1 month ago

When I try to navigate to classname by CTRL+Left Click from the logs it can not find it.

Environment
Steps To Reproduce
  1. Open demo.zip
  2. Run the DemoApplication.java
  3. Try to CTRL + Left Click on com.example.demo.DemoApplication from the logs image
  4. It will open input box with that full classname, however as it is full path it can not find it, only DemoApplication can be found. image
rgrunber commented 3 weeks ago

Yup, I see the same behaviour. The problem is in how the value shows up in the command palette. It's being inserted directly without the # at the beginning. That # is used to indicate it's a workspace symbol search. You can confirm this by doing Go -> Go To Symbol In Workspace and you'll see the command palette comes up with a # .

Initially I thought there's not much we can do since it seems like something VS Code handles. However, I looked inside vscode-java-debug (I assume you have this installed), I found : https://github.com/microsoft/vscode-java-debug/blob/main/src/terminalLinkProvider.ts#L18-L60 .

It looks like the current implementation only creates links for stacktrace elements. @jdneo does it make sense to move this into vscode-java-debug and add this as a proposed enhancement there ? Is the current "link-ification" of qualified elements coming from some default detection in VS Code itself ? Seems like vscode-java-debug should try to override it. Detecting fully qualified names might be tricky though.