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

Step into (F11) does not go inside dependency source code #893

Closed
seralbdev opened this issue Dec 26, 2020 · 5 comments
Closed

Step into (F11) does not go inside dependency source code #893

seralbdev opened this issue Dec 26, 2020 · 5 comments
Labels
bug Something isn't working debugger

Comments

@seralbdev
Copy link

Hi team
I would like to report an issue about the debugger. I have a project using a dependency from a project in my local disk (Clojure source code). When I debug the code in Emacs (function instrumented) and I go IN (i) the function I can step by step debug in the source code of the dependency. Emacs "jumps" automatically to the dependency source code

When I do the same in calva (F11) it doesn't behave in the same way. I lose control and system seems to be frozen?
The dependency is installed by lein install in the local .m2 maven cache and the original source code is accessible. The behaviour is different but both are installed in the same laptop...

I am a Clojure beginner...maybe it is lack of knowledge?
I am attaching videos and source code to reproduce

Many thanks in advance and keep to good work! Calva is getting really strong

Calva.mp4
Emacs.mp4

test.zip

@bpringe
Copy link
Member

bpringe commented Dec 26, 2020

Thanks for the repro case. I see this error in Output -> Log (Window) after it hangs on that step into:

Error: cannot open file:///jar%3Afile%3A/home/brandon/.m2/repository/testlib/testlib/0.1.0/testlib-0.1.0.jar%21/testlib/core.clj. Detail: Unable to read file '/jar:file:/home/brandon/.m2/repository/testlib/testlib/0.1.0/testlib-0.1.0.jar!/testlib/core.clj' (Error: Unable to resolve non-existing file '/jar:file:/home/brandon/.m2/repository/testlib/testlib/0.1.0/testlib-0.1.0.jar!/testlib/core.clj')

The path we get from cider-nrepl saying where the next breakpoint is looks like this: jar:file:/home/brandon/.m2/repository/testlib/testlib/0.1.0/testlib-0.1.0.jar!/testlib/core.clj.

I suspect we need to handle this in some way that vscode.workspace.openTextDocument likes. It's this line that the execution is not getting past:

const document = await vscode.workspace.openTextDocument(filePath);

I suspect the function called in the line above doesn't handle this case correctly. I'll play around with it more and see if I can figure out what needs to be done. @PEZ might have some insight here about opening files inside of jar packages.

@bpringe bpringe added the bug Something isn't working label Dec 26, 2020
@bpringe
Copy link
Member

bpringe commented Dec 26, 2020

I get it a little further by passing a vscode.Uri to openTextDocument instead of a string path. This causes our text document content provider to be called which handles jar files:

provideTextDocumentContent(uri, token) {

What seems to be failing now is VS Code using the StackFrame returned from stackTraceRequest to navigate to the code. I think something different needs to be passed when constructing the Source there.

@bpringe
Copy link
Member

bpringe commented Dec 27, 2020

This should be fixed in the next Calva release 🎉

@seralbdev
Copy link
Author

That was fast ;)
Excellent news & great job
Thanks so much 🙏

@PEZ PEZ closed this as completed in 4f985b1 Dec 27, 2020
@bpringe
Copy link
Member

bpringe commented Dec 27, 2020

You're welcome, and thank you for the detailed report.

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

No branches or pull requests

2 participants