Skip to content

v0.3.0 - Enhanced AST Analysis & Parameter Extraction

Latest

Choose a tag to compare

@christopherhwood christopherhwood released this 20 Jun 22:12
· 3 commits to main since this release

πŸš€ 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

npm install [email protected]

πŸ”— Related Projects