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

Unable to start adapter: 'projectName' in java debugger #221

Open
o-oconnell opened this issue May 14, 2023 · 2 comments
Open

Unable to start adapter: 'projectName' in java debugger #221

o-oconnell opened this issue May 14, 2023 · 2 comments

Comments

@o-oconnell
Copy link

A couple of questions that might resolve this before you look at the bug report:

  • How do you determine the behavior of the vscode.java.xxxx commands? Is it via reading the code of https://github.com/Microsoft/java-debug? Is that jar bundled in the lsp-jdtls package?
  • What is the workflow for debugging/editing Debugger? Do you use the sublime_debug adapter? I have tried unsetting the development flag but it does not seem to show up in any menus for me. I have also tried quickly reloading the plugin with the sublime_plugin.reload_plugin() method which gives no output (but does not fail) yet does not seem to successfully reload the plugin, so I have had to shut down and restart sublime text repeatedly.

So I am getting this bug after running the start method in the java adapter, but I am not sure how to reproduce it. I have fixed it previously by copying all of my code into a new directory and creating a new sublime-project, but I am still not sure why that worked. The java code in examples always works for me.

Configuration (in /home/xxxx/Downloads/Downloads/www2/src/main/java/compiler/conf.sublime-project)

{
	"folders":
	[
		{
			"path": "/home/hjkl/www2",
		}
	],
	"debugger_configurations":
	[
		{
			"type": "java",
			"name": "Launch with Arguments Prompt",
			"request": "launch",
			"mainClass": "compiler.puny",
			"args": "-dot /home/hjkl/www2/src/main/java/good_semantics_cse107/winds.py"
		},
	],
}

Console:

matches is [{'filePath': '/home/xxxx/Downloads/Downloads/www2/src/main/java/compiler/puny.java', 'mainClass': 'compiler.puny'}] (my print statement)
Debugger: error: Unable to start adapter: 'projectName'
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 69, in _get_mainclass_project_name
    return matches[0]['mainClass'], matches[0]['projectName']
KeyError: 'projectName'

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: 'projectName'
@LDAP
Copy link
Contributor

LDAP commented May 14, 2023

Can you provide a minimal example where that issue occurs?

@daveleroy
Copy link
Owner

The sublime adapter for debugging plugins is still a work in progress

To restart you should generally be able to save the start.py and it will reload the entire package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants