posit-dev / positron

Positron, a next-generation data science IDE
Other
1.59k stars 43 forks source link

Ark debugger support #408

Open kevinushey opened 1 year ago

kevinushey commented 1 year ago

Basic implementation in https://github.com/posit-dev/amalthea/pull/79 and https://github.com/posit-dev/positron/pull/1135.

Main missing features:

Generalised source availability:

Fallback srcref issues:

Reported issues:

jmcphers commented 1 year ago

We will want to use the Debug Adapter Protocol for this since doing so will let us integrate with all of VS Code's extensive tooling and UI for debugger support.

https://microsoft.github.io/debug-adapter-protocol/

At first glance, however, I don't see a way for the debug adapter to notify the host that the debugger is active or otherwise initiate a debug session, so that might be something we need to reconcile. Perhaps we can treat it as always attached?

Debugger support is going to be quite a lot of work and may not fit for public beta.

lionel- commented 9 months ago

After https://github.com/posit-dev/amalthea/pull/79 and https://github.com/posit-dev/positron/pull/1135 we now have basic debugger support.

Current features:

Missing features in order of importance (at least my understanding) for alpha users:

jennybc commented 9 months ago

I think #1440 contains some more candidates for things to work on (completion, focus).

lionel- commented 4 months ago

I've added a "Generalised source availability" section for creating source references from various sources that point to virtual documents. With these implemented, we'll provide R users with the same sort of full transparency experience that users of environments like Emacs enjoy. This makes it a breeze to discover and understand how dependencies are implemented and makes for a very comfortable debugging experience.

I'm currently leaning towards using virtual documents instead of unpacking as temp files, so we don't have to manage the resources or deal with users editing the files. Unfortunately this will only be available via jump to definitions / references actions, or via debugger stepping. That said the file explorer might gain access to these virtual documents in the future if this LSP extension gets implemented: https://github.com/NTaylorMullen/LSPVirtualDocuments/blob/master/Documents/FileSystemSpec.md.

Edit: oh but it looks like VS Code already supports providing a file system, so we could look at that in the future: https://code.visualstudio.com/api/references/vscode-api#FileSystemProvider

Of course it'd be even better if R packages bundled actual source files to be installed on disk. Alas for now we're stuck with source references that we have to create most of the time since repos do not actually bundle them.