Skip to content

R: module$function() call syntax not resolved to CALLS edges #219

@marcusyoung

Description

@marcusyoung

Summary

In R code using the box module system, functions imported from other modules are called using $ accessor syntax — e.g., validation$validate_input(x). The call resolution pipeline does not resolve this pattern, so no CALLS edge is created between the calling function and validate_input. Call chains are silently truncated at module boundaries.

Expected behaviour

module$function() call syntax should be resolved to a CALLS edge where the target is the qualified name of the function in the source module, provided the source module can be identified from an IMPORTS edge (see companion issue on box::use() parsing).

Actual behaviour

No CALLS edge is created. trace_path on any function called via $ syntax shows zero callers, regardless of actual usage in the codebase.

Minimal example

# app/view/map_panel.R
box::use(
  app/logic/validation[validate_input]
)
 
map_server <- function(id) {
  shiny::moduleServer(id, function(input, output, session) {
    result <- validation$validate_input(input$track)  # not resolved
  })
}

trace_path on validation$validate_input (or app/logic/validation::validate_input) returns no callers. map_server does not appear in any call chain originating from validate_input.

Context

This pattern is ubiquitous in Rhino applications and in any R code using box. It is distinct from the standard package::function() namespace syntax (which uses :: and may already be handled). The $ accessor is specific to box's imported-alias calling convention.

Both issues are related: resolving the call target in this issue depends on knowing what module the alias refers to, which requires IMPORTS edge support from the companion issue.

Version

0.6.0 (Windows amd64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingparsing/qualityGraph extraction bugs, false positives, missing edges

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions