dgkf / debugadapter

Debug Adapter Protocol implementation for R
GNU General Public License v3.0
18 stars 2 forks source link

Effective immediately! Drop support for stable R :stuck_out_tongue_closed_eyes: #15

Open dgkf opened 4 months ago

dgkf commented 4 months ago

This project hit a few constraints that made it mostly dead-on-arrival. Most notably, the lack of any hooks for interacting with an ongoing browser session.

Well that looks like it's unofficially been solved in bugs.r-project.org discussion.

We now have an experimental global option to add a browser "error handler", which allows us to hook into conditions intercepted by the browser.

I see this as almost an inevitability in the R world, so I'm willing to stake the project against the eventual inclusion of such a feature. Instead of even entertaining support for current versions of R and contorting the project to work in that scheme, I think it's better to throw all that out and use this much more direct mechanism of intercepting the debugger.

dgkf commented 4 months ago
dgkf commented 4 months ago

Note, this probably means the next stage of this project will only work on R-devel, compiled with the -DUSE_BROWSER_HOOK flag set. Because I build R from source ever few years -- leaving just enough time to completely forget what I'm doing -- I'm going to document my exact steps:

svn checkout https://svn.r-project.org/R/trunk R
cd R

# fetch recommended packages
./tools/rsync-recommended

# make a build target directory
mkdir target
cd target

# in my case, i'm on wayland with no x11
../configure --without-x CPPFLAGS=-DUSE_BROWSER_HOOK
make

# finally, launch our browser-hook-enabled R
bin/R
dgkf commented 4 months ago

Taking some notes on Luke's browser hooks implementation. More of a "user acceptance testing" style feedback, with my own thoughts on this as an API for hooking into the browser:

Impressions

Overall, the design feels like it's at odds with itself. The hook is used to catch entering into the browser, automatically resets the hook, then to actually enter a browser while intercepting future browser steps you have to reintroduce the hook and call browser with a ignoreHook flag. My impulsive response to such a design is that it feels overly complicated for what it allows.

Further Questions / Suggestions


tagging @lionel- - maybe interesting to you if you're hoping to stabilize this feature for your DAP implementation

PMassicotte commented 4 months ago

Cool to see it reviving :+1: Just for my understanding, is it supposed to currently work in its current state? I have tried to use it a couple of times without success.

dgkf commented 4 months ago

is it supposed to currently work [within neovim] in its current state?

When I was working in this, neovim was what I used to test to see if it was working. There were quite a few very specific steps to get it working - I needed to use a fork of processx where I enabled intercepting of the stdin file handle and it would only work on unix-like platforms where processes can be forked.

This iteration will require a devel build of R with the -DUSE_BROWSER_HOOK flag, which is its own burden on the project, but it will be cross platform and less flaky.

As soon as I have a minimal example I’ll write up new config steps for neovim and hopefully helix.