Skip to content

feat: Complete FastAPI multiline support and resolve DotNet parsing artifacts#49

Merged
zerochae merged 1 commit intomasterfrom
feature/fastapi-multiline-support
Sep 24, 2025
Merged

feat: Complete FastAPI multiline support and resolve DotNet parsing artifacts#49
zerochae merged 1 commit intomasterfrom
feature/fastapi-multiline-support

Conversation

@zerochae
Copy link
Copy Markdown
Owner

Summary

  • ✨ Implement comprehensive FastAPI multiline decorator highlighting with proper end-line detection
  • 🐛 Fix critical DotNet parser ripgrep multiline artifacts that were producing malformed endpoint results
  • 🏗️ Add realistic FastAPI test fixtures with proper layered architecture structure
  • 📝 Document comment filtering enhancement for future implementation

Changes Made

FastAPI Multiline Support

  • Enhanced FastApiParser:_extract_path_multiline to return both path and end_line_number
  • Fixed multiline decorator highlighting to include closing parentheses/brackets
  • Added comprehensive test fixtures in tests/fixtures/fastapi/src/app/presentation/http/controllers/multiline/
  • Implemented proper end_line_number calculation for complete decorator block highlighting

DotNet Parser Artifact Resolution

  • Critical Fix: Resolved ripgrep multiline artifacts producing results like GET /api/v1/products/)] public class ProductsController...
  • Enhanced _extract_route_info to properly handle [HttpGet] + [Route("")] combinations
  • Fixed empty Route attribute parsing (e.g., [Route("")] now correctly returns empty string)
  • Improved content cleaning to preserve HTTP method + Route attribute pairs while filtering unwanted artifacts
  • Narrowed Route attribute search scope to method-level only (avoiding class-level Route conflicts)

Infrastructure Improvements

  • Updated meta/types.lua with proper type annotations for new multiline functionality
  • Enhanced multiline content cleaning with better artifact detection patterns
  • Added TODO.md documenting systematic comment filtering enhancement for all frameworks

Test Results

-- FastAPI: All multiline patterns now highlight complete decorator blocks
@router.get(
    "/users/{user_id}",
    response_model=UserResponse
) ✅ Full highlighting


-- DotNet: Artifacts resolved, proper path extraction
[HttpGet]
[Route("")] → GET /api/v1/productsClean result

Files Changed

  • lua/endpoint/parser/fastapi_parser.lua - Multiline highlighting support
  • lua/endpoint/parser/dotnet_parser.lua - Artifact resolution and Route handling
  • meta/types.lua - Type annotations update
  • tests/fixtures/fastapi/src/app/presentation/http/controllers/multiline/ - Realistic test fixtures
  • TODO.md - Comment filtering documentation

Breaking Changes

None. All changes are backwards compatible improvements.

Future Work

  • Comment filtering implementation across all frameworks (documented in TODO.md)
  • Apply similar multiline highlighting fixes to other frameworks (NestJS, Ktor, etc.)

…rtifacts

- Implement comprehensive FastAPI multiline decorator highlighting
- Add realistic FastAPI test fixtures with proper project structure
- Fix DotNet parser ripgrep multiline artifacts in ProductsController
- Allow empty Route attributes in [HttpGet] + [Route("")] combinations
- Improve multiline Route attribute detection and path extraction
- Enhance content cleaning for HTTP method + Route attribute pairs
- Add proper end_line_number calculation for both frameworks
- Document comment filtering enhancement in TODO.md

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

Co-Authored-By: Claude <noreply@anthropic.com>
@zerochae zerochae merged commit de74bc2 into master Sep 24, 2025
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