Repository navigation
Description
Summary
.r/.R is included in detect.py's CODE_EXTENSIONS set, so R files are classified as FileType.CODE and counted in the scan summary (e.g. found 24 code, ...). But extract.py's _DISPATCH dict — the table that maps extensions to an actual AST extractor function — has no .r/.R entry at all (it covers ~45 languages: Python, JS/TS, Go, Rust, Java, Ruby, C/C++, Swift, Kotlin, Scala, PHP, Lua, Zig, PowerShell, Elixir, Objective-C, Julia, Fortran, Vue, Svelte, Astro, Dart, Verilog, SQL, Pascal/Delphi, DragonFly BASIC, .NET project files, etc. — but not R).
Reproduction
Run graphify extract . on a project that's mostly .R scripts (e.g. an R/renv analysis project with ~17 .R files and a handful of .py helper scripts).
- Scan step reports something like
found 24 code, 0 docs, 1 papers, 0 images— the R files are counted as code. - AST extraction runs on all 24 "code" files.
- The resulting
graph.jsononly contains nodes/edges from the non-R files (in my case, 7 small Python scripts). All ~17.Rfiles contribute zero nodes and zero edges. - No warning, error, or log line indicates this. The CLI reports success (
wrote graph.json: N nodes, M edges, K communities) as if the whole codebase was mapped.
Root cause
In extract.py:
def _get_extractor(path):
...
return _DISPATCH.get(path.suffix)For a .R file, _DISPATCH.get(".R") returns None (no key for .r or .R). The caller handles this by silently returning an empty result:
extractor = _get_extractor(path)
if extractor is None:
return idx, {"nodes": [], "edges": []}Meanwhile detect.py::classify_file lowercases the extension before checking CODE_EXTENSIONS (ext = path.suffix.lower()), so .R files do get classified as FileType.CODE and counted in scan stats — creating a mismatch between "files graphify says it found as code" and "files graphify can actually parse."
Impact
For any primarily-R codebase, graphify extract silently produces a graph that reflects none of the actual project code, with no indication to the user that anything was skipped. This is worse than an explicit "unsupported language" error, because the tool reports success and the user has no reason to suspect the graph is incomplete/misleading.
Suggested fix
Either:
- Add a real
.r/.Rextractor (tree-sitter has an R grammar —tree-sitter-r), consistent with how other languages are wired into_DISPATCH; or - At minimum, when
_get_extractor()returnsNonefor a file thatclassify_file()counted asFileType.CODE, surface a warning (e.g.[graphify extract] WARNING: N code files have no AST extractor and were skipped: .R (17), ...) instead of silently returning empty results and reporting overall success.
Option 2 alone would have saved a lot of confused debugging — the CLI output gave no signal that anything was wrong.
Activity
fix(extract): warn when code files have no AST extractor instead of s…
safishamsi commentedon Jul 6, 2026
Fixed on
v8(377dc7f), shipping in the next release — went with your option 2 (surface it) for now.You were exactly right about the mismatch:
.r/.R(also.ejs,.ets) are inCODE_EXTENSIONSso they're classified as code and counted, but there's no dispatch entry, so_get_extractorreturnsNoneand the file contributes zero nodes. The #1666 zero-node warning couldn't catch these because it only fires when an extractor exists.extract()now emits, grouped by extension:It fires only for files actually present with no extractor (today that's just
.ejs,.ets,.r), so a primarily-R corpus no longer reports success as if it were mapped. Regression tests cover the warning and the no-warning case.Adding a real
tree-sitter-rextractor (your option 1) is the natural follow-up and I'll leave this issue's spirit tracked for that; the silent-data-loss part is resolved now. Thanks for the precise root-cause.fix(extract): don't force-parse MATLAB .m through the Objective-C gra…
Release 0.9.9
fix(extract): warn when files skip extraction for a missing optional …
feat(extract): add regex-based R (.r/.R) extractor (Graphify-Labs#1689)
fxi commentedon Jul 15, 2026
Native tree-sitter-r support would be nice. Currently working on a Legacy R Shiny app migration, and the struggle is real
Add: R (.r/.R) language support via bespoke extract_r
tihh07 commentedon Jul 27, 2026
Still reproducing on 0.9.22, and I want to add a data point about how much this silently removes, plus a note on #2116.
Concrete case
A private analytics repo whose core is an R pipeline (43
.Rfiles, ~120 files total, mixed R / SQL / Markdown)..Rfiles on disk.sql12,.ts8,.py3,.ps12, extensionless 2)The cascade is what makes it costly, and it is worth spelling out because each step is individually reasonable:
.ris inCODE_EXTENSIONSandanalyze.pymaps it to languager, so the file is counted as code;document/paper/image).So R files fall between the two extractors rather than being handled by either. Exit code is 0.
The only R content that reached my graph got there indirectly: 119 nodes whose
source_filepoints at.Rpaths, wired together by 86callsedges with both ends inside that set — but every one of those nodes hassource_location: nulland_originunset — LLM nodes attributed to R files while reading the project's Markdown, not parser output. They cover 22 of 43 files; the other 21 have no node at all, including the pipeline's top-level orchestrator and an entire 5-script chain that writes to Postgres.That is the failure mode worth highlighting: the graph does not look empty on R. It looks populated, with plausible function names and call edges, so a consumer has no signal that half the corpus is missing and that none of it is anchored to a line. The
#1689warning on stderr is the only thing standing between that graph and a wrong conclusion — which is why I would argue it should be surfaced inGRAPH_REPORT.mdtoo, not just stderr, for as long as the gap exists.#2116 looks closed in error
#2116 ("Feature Request: Native Tree-sitter Support for R", where the author offered to contribute the extractor) was closed as COMPLETED on 2026-07-22 — but nothing appears to have shipped:
0.9.27(latest, released 2026-07-26) has notree-sitter-rinpyproject.toml;graphify/extractors/r.pyonmain;pip install "graphifyy[all]"pulls no R grammar — there is norextra.If that close was a mistake, reopening it would also stop the next person from concluding, as I nearly did, that upgrading fixes this.
Happy to test a branch against the repo above if an extractor lands — the R here is ordinary CRAN-style code (
<- function(),pkg::fun,source()), so it is a fair smoke test.juliethsantamaria commentedon Aug 9, 2026
Hi! I'm an economist using Graphify to build a knowledge graph for
research projects.
Request: Add R and Stata Language Support
I work extensively with both R and Stata
(statistical analysis and econometric modeling), and both are currently silently dropped from the graph with no warning.
R Support
Good news: Tree-sitter already has a mature, actively maintained
R grammar maintained by the R-lib team (Posit/RStudio):
Integration should be straightforward given the existing grammar.
Stata Support
Also good news: A production-quality tree-sitter-stata grammar
already exists and is actively maintained by Jonathan Bearak:
Rather than building from scratch, Graphify could integrate or adapt
the existing grammar.
Why This Matters
and quantitative social science
projects combining code, papers, data, and analysis scripts
What I Can Provide
I'm happy to support implementation by providing:
prioritized for extraction (function definitions, program calls,
variable operations, etc.)
Summary
Both R and Stata already have working tree-sitter grammars. The
integration work is the remaining piece. This would unblock
economists and other quantitative researchers from using Graphify
for reproducible research.
fix(extract): warn when code files have no AST extractor instead of s…
fix(extract): don't force-parse MATLAB .m through the Objective-C gra…
Release 0.9.9
fix(extract): warn when files skip extraction for a missing optional …
bastienchassagnol commentedon Aug 23, 2026
+1 from the DeCovarT R package (bastienchassagnol/DeCovarT) — bulk RNA-seq deconvolution with a sizeable exported API under
R/(numeric-prefixed modules, tests mirroring stems, scripts + Quarto vignettes).We are trying graphify as a local knowledge graph in Cursor. On v0.9.48,
--code-onlyreports our.Rfiles as code but they contribute zero nodes (the warning about missing extractors helped; thanks for surfacing that). The graph is otherwise dominated by vendored JS underslides/_extensions/until we trim via.graphifyignore.An R/tree-sitter-r extractor would materially help R package authors: map
@exportentry points,@inheritParamschains, testthat coverage ofR/03_03_*.R, and call paths into optimisation helpers — the sort of cross-file structure grep alone misses. Option (2) (explicit skip warnings) is already a big UX win; option (1) would make graphify genuinely useful for CRAN/Bioc-style repos like ours.Happy to retest on a build that adds
.Rsupport.LarryCalvert commentedon Aug 24, 2026
Confirming this is still present as of graphify 0.9.48. One update: it no longer fails silently — I get an explicit warning now (X file(s)... no AST extractor for their language: .r (N)), so that part seems to have been addressed. But the R files still contribute zero nodes to the graph.
Also worth noting: the v0.6.2 changelog lists "R language (.r) support via LLM semantic extraction" as a shipped feature. That fallback doesn't appear to be happening either — my .r files weren't included in the semantic-extraction batch, only my docs/PDFs/images were. So it looks like R support regressed from a working (semantic-pass) state in v0.6.2 to a fully-dropped state now, rather than never having existed.
0.9.47+trifour.7: consumer paths skip Graphify-Labs#1689; AST progres…
0.9.57+trifour.1: merge upstream v8 (0.9.57)
Merge upstream/v8 (graphify 0.9.61, +559 коммитов) в 1C/BSL + ArcadeD…
fork delta on upstream v0.9.61: consumer extractor host, config layer…
fork delta on upstream v0.9.61: consumer-extractor host, config layer…
feat(extract): add EJS (.ejs) template extractor (#3811)
omsenjalia commentedon Oct 18, 2026
This looks fixed on the
v8branch by commits d68d6012 (feat: add R language extractor), 377dc7f3 (fix(extract): warn when code files have no AST extractor instead of silently dropping them (#1689)). Could a maintainer confirm and close?feat: ArkTS (.ets) and HarmonyOS project-config extraction