Skip to content

feat: add R language parsing support#43

Closed
michael-denyer wants to merge 5 commits intotirth8205:mainfrom
michael-denyer:feat/r-language-support
Closed

feat: add R language parsing support#43
michael-denyer wants to merge 5 commits intotirth8205:mainfrom
michael-denyer:feat/r-language-support

Conversation

@michael-denyer
Copy link

@michael-denyer michael-denyer commented Mar 20, 2026

Summary

  • Add tree-sitter based R language parsing: functions (via <-/= assignment), S4/R5 classes (setClass/setRefClass/setGeneric), imports (library/require/source), namespace-qualified calls (dplyr::filter), and testthat test detection
  • R-specific helpers (_r_call_func_name, _r_first_string_arg, _r_iter_args, _r_find_named_arg) keep AST traversal flat and readable
  • Dedicated handlers: _handle_r_binary_operator, _handle_r_call, _handle_r_class_call, _extract_r_methods
  • Update README to list R as 14th supported language (alongside Vue from feat: add Vue SFC parsing support #40)
  • Include design spec, test fixtures (sample.R, test_sample.R), and 9 tests in TestRParsing

Test Plan

  • All 9 R parsing tests pass (language detection, functions, classes, methods, imports, calls, params, contains, test detection)
  • All 191 tests pass (no regressions, includes upstream Vue + security changes)
  • Ruff lint clean

Add tree-sitter based R language parsing with support for:
- Function definitions via <- and = assignment operators
- S4/R5 class detection (setClass, setRefClass, setGeneric)
- Class method extraction from setRefClass methods lists
- Import detection (library, require, source)
- Namespace-qualified calls (dplyr::filter)
- testthat test file pattern detection

Includes test fixture (sample.R) and 8 tests in TestRParsing.
- Fix continue indentation in _collect_file_scope so only function
  definition binary_operators skip remaining checks
- Remove dead ".R" entry from EXTENSION_TO_LANGUAGE (.lower() already
  handles case-insensitive matching)
- Add test_detects_test_functions test with test_sample.R fixture to
  exercise test file/function detection for R
- Extract _r_call_func_name, _r_first_string_arg, _r_iter_args,
  _r_find_named_arg to flatten deeply nested AST traversal loops
- Simplify _handle_r_class_call, _extract_r_methods, _extract_import
  using the new helpers
- Update README to list R as 13th supported language
Integrate Vue SFC support, security hardening, and governance changes
from upstream while preserving R language support additions.
Include both Solidity (from upstream) and R in the language list,
bringing the total to 15 supported languages.
tirth8205 added a commit that referenced this pull request Mar 26, 2026
Adds R language parsing with function extraction (both <- and = assignment),
S4/R5 class detection via setClass/setRefClass, library/require/source
imports, namespace-qualified calls (dplyr::filter), and testthat test detection.

Co-Authored-By: michael-denyer <noreply@github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tirth8205 added a commit that referenced this pull request Mar 26, 2026
…nfigurable embeddings, MiniMax, Perl)

* feat: integrate PR #43 — R language support

Adds R language parsing with function extraction (both <- and = assignment),
S4/R5 class detection via setClass/setRefClass, library/require/source
imports, namespace-qualified calls (dplyr::filter), and testthat test detection.

Co-Authored-By: michael-denyer <noreply@github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: integrate PR #54 — Vitest/Jest test detection

Adds describe/it/test block parsing for JS/TS test files, producing
synthetic Test nodes with description labels. Supports modifier suffixes
(describe.only, it.skip, test.each) and nested describe/it containment.

Co-Authored-By: JF10R <noreply@github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: integrate PR #53 — tsconfig path alias resolution

Adds TsconfigResolver module that resolves TypeScript path aliases
(e.g., @/ -> src/) from tsconfig.json compilerOptions.paths. Also
resolves import targets to absolute file paths in IMPORTS_FROM edges.

Co-Authored-By: JF10R <noreply@github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: integrate PR #58 — .mjs/.astro support

Adds .mjs extension mapping to JavaScript and .astro extension mapping
to TypeScript for import path resolution.

Co-Authored-By: zoneghost7 <noreply@github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: integrate PR #55 — configurable embedding model

Adds CRG_EMBEDDING_MODEL env var and model parameter to embedding
functions, allowing users to specify any sentence-transformers compatible
model. Changing the model re-embeds all nodes automatically.

Co-Authored-By: eugenepro2 <noreply@github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: integrate PR #45 — MiniMax embedding provider

Adds MiniMaxEmbeddingProvider using the embo-01 model (1536 dimensions)
with support for distinct task types (db/query), batching, and retry logic.

Co-Authored-By: octo-patch <noreply@github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: integrate PR #62 — Perl support

Adds Perl language parsing with package detection, subroutine extraction,
use/require imports, and function call tracking. Includes test fixture
and comprehensive test class.

Co-Authored-By: potatogim <noreply@github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: michael-denyer <noreply@github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tirth8205
Copy link
Owner

Integrated into main via PR #68. Thank you for the contribution! 🎉

@tirth8205 tirth8205 closed this Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants