R has no declaration syntax — everything is an expression — so the extractor works through the visitNode hook: functions in every assignment form (incl. nested, attributed to their enclosing scope), top-level variables/constants, library()/require() imports and source() file references (claimed, Lua-style), S4/RefClass/R6/ggproto classes with their methods and extends edges, setGeneric/setMethod. Grammar vendored from r-lib/tree-sitter-r v1.2.0 (ABI 14; npm package is a security placeholder, tree-sitter-wasms has no R). Benchmarked on AnomalyDetection (8/8 named defs), dplyr (1027 fns), ggplot2 (150 ggproto classes / 597 methods / 128 extends edges — adding ggproto mid-bench flipped the large-repo A/B from a regression to 2.4x faster than the no-codegraph arm). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
2c7bbd5387
commit
06a410e9b4
@@ -24,6 +24,7 @@ import { dartExtractor } from './dart';
|
||||
import { pascalExtractor } from './pascal';
|
||||
import { scalaExtractor } from './scala';
|
||||
import { luaExtractor } from './lua';
|
||||
import { rExtractor } from './r';
|
||||
import { luauExtractor } from './luau';
|
||||
import { objcExtractor } from './objc';
|
||||
|
||||
@@ -47,6 +48,7 @@ export const EXTRACTORS: Partial<Record<Language, LanguageExtractor>> = {
|
||||
pascal: pascalExtractor,
|
||||
scala: scalaExtractor,
|
||||
lua: luaExtractor,
|
||||
r: rExtractor,
|
||||
luau: luauExtractor,
|
||||
objc: objcExtractor,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user