3 ms·
I've been thinking about an R package, or maybe a more general treesitter-based package, to reorganize functions in a project. Something like a tui which shows
by dash2 6mo ago
I've been thinking about an R package, or maybe a more general treesitter-based package, to reorganize functions in a project. Something like a tui which shows you functions in files in folders and lets you copy and paste them around; and maybe use graph analysis to automate this, analysing function dependencies and putting each "community" of functions into one file.
Is there any interest in this? There are per-language complexities, for example R functions are often preceded by a roxygen block which ought to travel with it. Has anyone done something similar?
- mscbuck 6mo agoI think that'd be cool, but I'd say that Claude Code/Codex is often used for this exact thing and they do a decent job of it (at least in my experience with R). Usually once I've kind of wrapped up my model or data work I'll just ask "okay, now organize this so it makes sense", and it usually does a great job at organizing the helpers, etc.
- tylermw 6mo agoI've done exactly what you're talking about using tree-sitter (via the tarborist VS Code extension), specific to targets pipelines: https://bsky.app/profile/tylermw.com/post/3mjmcykuows2d https://bsky.app/profile/tylermw.com/post/3mjmcykuows2d So yes, it is possible and quite useful!
- dash2 6mo agoSounds easy to generalize to R packages which would be a wider audience!