From 6c487cffdbd3fcbc4a08acf6ddb71af735b75d06 Mon Sep 17 00:00:00 2001 From: Mick Cooney Date: Fri, 16 Oct 2026 17:11:11 +0100 Subject: [PATCH] fix(r): bind roxygen @param tags to formals written in backticks A formal written `data` in backticks never matched the tag @param data, so its documented type was dropped. Look the tag up by the symbol. --- gitnexus/src/core/ingestion/type-extractors/r.ts | 4 +++- gitnexus/test/unit/type-env-r.test.ts | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gitnexus/src/core/ingestion/type-extractors/r.ts b/gitnexus/src/core/ingestion/type-extractors/r.ts index b1a815f22..f5e159b8c 100644 --- a/gitnexus/src/core/ingestion/type-extractors/r.ts +++ b/gitnexus/src/core/ingestion/type-extractors/r.ts @@ -7,6 +7,7 @@ import type { } from './types.js'; import type { SyntaxNode } from '../utils/ast-helpers.js'; import { getRClassNameArgument } from '../field-extractors/r.js'; +import { rBareName } from '../languages/r/bare-name.js'; /** * R type extractor — roxygen2 annotation parsing. @@ -205,7 +206,8 @@ const extractParameter: ParameterExtractor = (node: SyntaxNode, env: Map { + const tree = parse(` +DataFrame <- R6::R6Class("DataFrame", public = list(rows = function() 1)) + +#' @param data DataFrame +Summarise <- function(\`data\`) { + \`data\`$rows() +} +`); + const typeEnv = buildTypeEnv(tree, SupportedLanguages.R); + expect(flatGet(typeEnv, '`data`')).toBe('DataFrame'); + }); + it('binds nothing for a type the file does not define (primitive or capitalised)', () => { const tree = parse(` #' @param x numeric