Open o-oconnell opened 1 year ago
Also using https://github.com/microsoft/vscode-java-debug/releases/download/0.49.1/vscjava.vscode-java-debug-0.49.1.vsix as java debugger
I noticed that https://github.com/LDAP/sublime_debugger/blob/b96bd290b71c64d0024bd800246603491aba6af2/modules/adapters/util/lsp.py#L22 and https://github.com/daveleroy/SublimeDebugger/blob/master/modules/adapters/util/lsp.py#L8
have switched the command from "debugger_lsp_bridge_request" to "debugger_bridge_lsp_request" but that doesn't seem to fix it- could be related?
Do you know if there is a way to view a log of commands sent to sublime text via sublime.active_window().run_command(command, data)? Could be an error in there but I can't find a log.
Yes you can log commands by executing sublime.log_commands(True)
in the console.
Maybe try deleting the folder Debugger33 in the Packages folder and restarting sublime.
Maybe try deleting the folder Debugger33 in the Packages folder and restarting sublime.
This worked for me. Thanks. I have a new error for my config, but at least that's my fault.
Yes that solved this issue for me as well thanks, I'll put a more complete list of the bugs I had after that and how I solved them when my school is finished, cheers.
Two more bugs I have found are the adapter failing to resolve the project name (#221) and a "failed to resolve main class". The main class cannot be resolved if there is no string passed to its main method. If you change the java code in examples to:
class Main {
public static void main(){
System.out.println("Test");
}
}
You will get:
Debugger: error: Unable to start adapter: Mainclass Main not found. Check your debugger configuration or leave "mainClass" empty to detect the mainclass automatically
Traceback (most recent call last):
File "/home/xxxx/.config/sublime-text/Packages/Debugger/modules/dap/session.py", line 192, in _launch
transport = await self.adapter_configuration.start(log=self.log, configuration=self.configuration)
File "/home/xxxx/.config/sublime-text/Packages/Debugger/modules/adapters/java.py", line 36, in start
configuration['mainClass'], configuration['projectName'] = await self._get_mainclass_project_name(None if _is_undefined('mainClass') else configuration['mainClass'])
File "/home/xxxx/.config/sublime-text/Packages/Debugger/modules/adapters/java.py", line 71, in _get_mainclass_project_name
raise core.Error('Mainclass {} not found. Check your debugger configuration or leave "mainClass" empty to detect the mainclass automatically'.format(preferred_mainclass))
Debugger.modules.core.error.Error: Mainclass Main not found. Check your debugger configuration or leave "mainClass" empty to detect the mainclass automatically
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/xxxx/.config/sublime-text/Packages/Debugger/modules/dap/session.py", line 162, in launch
await self.launching_async
File "/home/xxxx/.config/sublime-text/Packages/Debugger/modules/dap/session.py", line 194, in _launch
raise core.Error(f'Unable to start adapter: {e}')
Debugger.modules.core.error.Error: Unable to start adapter: Mainclass Main not found. Check your debugger configuration or leave "mainClass" empty to detect the mainclass automatically
However this works fine:
class Main {
public static void main(String[] args){
System.out.println("Test");
}
}
@o-oconnell
The main class cannot be resolved if there is no string passed to its main method.
This is just how Java works (the signature of a main method is clearly defined as public static void main(String[])
), that has nothing to do with the JDTLS or Debugger.
@daveleroy The only issue remaining is that sometimes the Debugger33
package gets corrupted. In my case, the plugin file was empty and was not updated by Debugger.
@daveleroy The only issue remaining is that sometimes the Debugger33 package gets corrupted. In my case, the plugin file was empty and was not updated by Debugger.
Debugger33 only gets updated if it was removed in plugin_unloaded
so if you aren't reloading the plugin it might never get updated.
I guess it could just always remove/install it in plugin_loaded
since plugin_unloaded
isn't called reliably.
Debugger: 0.10.1 LSP: 1.23.0 LSP-jdtls: 2.1.0
Steps to reproduce:
My sublime-project:
(there is a file test.java in my project with contents:
public class test { public static void main() { System.out.println("hello"); } }
Autocompletion / syntax highlighting are working fine with LSP-jdtls in this file, as evidenced by LSP: toggle log panel:
Sublime console log:
Protocol log:
It is clear that Debugger cannot connect to LSP-jdtls, so I assume it is an incorrect param or something since the language server is working. I also tried downgrading to Debugger 0.9.3 and LSP-jdtls 2.0.0, same bug. It is a timeout but I cannot get any more detail beyond that. Since it's a sublime command being run (https://github.com/daveleroy/SublimeDebugger/blob/master/modules/adapters/util/bridge.py#L33) maybe sublime has some sort of log that would give more info? I have not found it yet if so.
I was able to reproduce this with @LDAP 's fix: https://github.com/LDAP/sublime_debugger/tree/fix/false-lsp-object, essentially the same except you get an
asyncio.cancelledError
.