π Major Enhancements
β¨ New Features
- Enhanced Parameter Extraction:
extractParameters()
method supports all function types including destructuring, default parameters, and rest parameters
- Accurate Line Ranges: Added
endLine
property for precise function/class span calculation
- Async Detection:
isAsync()
method for reliable async function detection
- Body Range Analysis:
getBodyRange()
method for function/class body boundaries
- Structured Analysis:
getFunctionDetails()
and getClassDetails()
return comprehensive structured data
π§ API Improvements
- TypeScript Consistency: Use
undefined
over null
following TypeScript conventions
- Enhanced Interfaces: Updated
FunctionInfo
and ClassInfo
with bodyRange
support
- Better Developer Experience: Rich type definitions exported from library
π Enhanced Data Structures
// Function analysis now includes:
interface FunctionInfo {
name: string | undefined;
type: string;
async: boolean;
parameters: string[]; // π Actual parameters extracted
startLine: number;
endLine: number; // π Accurate end line
text: string;
bodyRange?: { // π Body boundaries
startLine: number;
endLine: number;
};
}
π― Benefits for MCP Server
- Function parameters show actual values instead of empty arrays
- Proper code navigation with accurate line ranges
- Enhanced code intelligence for AI agents
- Professional-quality analysis capabilities
π¦ Installation
π Related Projects