Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Could not load source '': SourceRequest: property 'sourceReference' is missing, null, or empty. #259
Comments
|
@cshung Reference Debug Adapter Protocol, we set sourceReference to
|
|
To help us investigate your issue, could you change vscode user settings After that, start debugging and debug protocol data will be logged. The log can be viewed by the vscode command |
|
it looks like vscode doesn't support relative path in the source.path field. Did you manually configure |
|
Yes, I did set a relative path in my launch.json. |
|
Yeah, we can improve it by appending Currently, you can specify |
for the if the uri is |
as @dassio says, sending a URI in the /**
* Determines in what format paths are specified. The default is 'path', which is the native format.
* Values: 'path', 'uri', etc.
*/
pathFormat?: string;It would be preferable and more portable and compliant for the DA to implement the Should this be raised as a new issue ? |
|
From the perspective of integration, making the debugger to return the contents will bring some new problem. One challenge is the language features won't work in the contents returned by debugger. Maybe we can add a switch (e.g. |
|
Maybe just check whether the client requested files or URIs. It's not valid to return a URI in the source
you mean like go-to-definition and such like ? is this somehow related to the custom "hot code reload" commands that the debug adapter/language server implement ? In that case, maybe you could base this decision off the support for that (e.g. if the client reports a custom capability that they support your custom protocol extensions, then send your jdt:// URIs, otherwise use the source request) ? Would that work? |
VS Code client sends
Yes, all language features such as go to definition, javadoc are supposed to work when you're actually debugging the code. That's why the debugger delegates the binary class source rendering to the language server. |
|
Ugh. de facto. Is there some way that the vscode-java extension could indicated to you that it does this/supports this out-of-protocol behaviour? That way the default behaviour can be in-protocol ? The problem is that outside of vscode there's no guarantee (or likelihood) that the DAP client and the LSP client are in any way related - they are totally different things. I realise that the java debugger being hosted in the language server is unique, and it requires some collusion (the 'startDebugSession' command the LSP client has to export), I would like to avoid coupling my DAP client to any one of myriad LSP clients in vim-land (and I assume the authors of other non-vscode DAP clients would agree). |
|
I got your point, but this repo is not a standalone project. This repo contains two components
If you want to keep the debugger running alone, then you must implement these provider interfaces by your own. |
this seems like an easier way without breaking or the need of synchronizing with the vscode-java project |
i don't think this is what @puremourning means, vscode is running vscode-java(LSP client) and vscode-java-debug(DAP client) together, @puremourning only want to run the vscode-java-debug alone without the LSP client(vscode-java). it is fine to have the |
|
well sure, if the best we can get is a command line argument when starting jdt.ls, then I guess we can ask the LSP client authors to work with that. There's already enough hacking to ask the LSP client to start the debug adapter and provide a port. Would it be possible for the
I feel like if I have to implement custom java processes as a DAP client author, that sort of defeats the purpose of having debug adapters implement a common protocol in the first place. Unfortunately I find myself in the 'one person in their spare time with a full time job' OSS world supporting vimspector and I would thoroughly like to leverage the great stuff that's being provided here and from jdt.ls in a way which doesn't mean a job for life just maintaining support for one adapter. |
|
Thank you for all the recent activities on this PR. This was 493 days ago, I already forgot what I did. I think I was experimenting with the closure compiler just to realize the debugger wasn't quite working as I expected, so I dug and 'fixed' it just to realize a very simple workaround existed for me. Let me know if there is something I can contribute on, I would be happy to do so. |


Cannot load source code during Java debugging in a certain scenario.
Environment
Steps To Reproduce
Current Result
The breakpoint hits, but then loading sour code fails with this error.
Could not load source '': SourceRequest: property 'sourceReference' is missing, null, or empty.
Expected Result
Loading source code should work.
Additional Information
This is a clone of issue 550 in the vscode-java-debug repo. I believe the root cause of the bug is in this repo, so I cloned the issue over.
I believe I have some idea why the scenario is failing:
I submitted a pull request for my idea in 3, I haven't been able to test this yet.