Skip to content

Conversation

@cherotuga
Copy link

Improve the .parse_function() function to better handle function calls that span multiple lines with arguments. The previous implementation used deparse() which was problematic for multi-line function calls.

Changes:

  • Add explicit handling for function calls with is.call(x) && length(x) >= 1
  • Capture function names and recursively parse arguments to find nested calls
  • Add proper symbol handling with is.symbol(x)
  • Remove problematic deparse() fallback that couldn't handle multi-line calls
  • Filter out empty results with out[nzchar(out)]
  • Add length check for safety in $ operator handling

This allows the project visualizer to correctly identify dependencies in functions with complex multi-line argument structures.

🤖 Generated with Claude Code

Improve the .parse_function() function to better handle function calls that span multiple lines with arguments. The previous implementation used deparse() which was problematic for multi-line function calls.

Changes:
- Add explicit handling for function calls with `is.call(x) && length(x) >= 1`
- Capture function names and recursively parse arguments to find nested calls
- Add proper symbol handling with `is.symbol(x)`
- Remove problematic deparse() fallback that couldn't handle multi-line calls
- Filter out empty results with `out[nzchar(out)]`
- Add length check for safety in $ operator handling

This allows the project visualizer to correctly identify dependencies in functions with complex multi-line argument structures.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Sep 6, 2025

Codecov Report

❌ Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
R/project_visualiser.R 0.00% 12 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

1 participant