33 * AI-powered intelligent code generation with full project context
44 */
55
6- import type { Tool } from '@modelcontextprotocol/sdk/types.js' ;
6+ // Tool type imported for future use in MCP schema definition
7+ // import type { Tool } from '@modelcontextprotocol/sdk/types.js';
78import { CodeAnalysisService } from '../services/code-analysis.js' ;
89import { AILLMService } from '../services/ai-llm.js' ;
910import { logger } from '../services/logger.js' ;
@@ -294,8 +295,8 @@ export class ContextAwareCodegenTool {
294295
295296 // Analyze actual naming patterns in the code
296297 const variableMatches = code . match ( / \b [ a - z ] [ a - z A - Z 0 - 9 ] * \b / g) || [ ] ;
297- const classMatches = code . match ( / \b [ A - Z ] [ a - z A - Z 0 - 9 ] * \b / g) || [ ] ;
298- const constantMatches = code . match ( / \b [ A - Z ] [ A - Z 0 - 9 _ ] * \b / g) || [ ] ;
298+ const _classMatches = code . match ( / \b [ A - Z ] [ a - z A - Z 0 - 9 ] * \b / g) || [ ] ;
299+ const _constantMatches = code . match ( / \b [ A - Z ] [ A - Z 0 - 9 _ ] * \b / g) || [ ] ;
299300
300301 // Detect actual patterns used
301302 if ( variableMatches . length > 0 ) {
@@ -439,7 +440,7 @@ function generatedFunction() {
439440 }
440441 }
441442
442- private generateFunction ( prompt : string , args : CodeGenerationRequest ) : string {
443+ private generateFunction ( prompt : string , _args : CodeGenerationRequest ) : string {
443444 const functionName = this . extractFunctionName ( prompt ) || 'newFunction' ;
444445 const hasAsync = prompt . toLowerCase ( ) . includes ( 'async' ) || prompt . toLowerCase ( ) . includes ( 'await' ) ;
445446 const hasError = prompt . toLowerCase ( ) . includes ( 'error' ) || prompt . toLowerCase ( ) . includes ( 'exception' ) ;
@@ -471,7 +472,7 @@ export function ${functionName}() {\n`;
471472 return code ;
472473 }
473474
474- private generateClass ( prompt : string , args : CodeGenerationRequest ) : string {
475+ private generateClass ( prompt : string , _args : CodeGenerationRequest ) : string {
475476 const className = this . extractClassName ( prompt ) || 'NewClass' ;
476477
477478 return `/**
@@ -507,7 +508,7 @@ export class ${className} {
507508}` ;
508509 }
509510
510- private generateTest ( prompt : string , args : CodeGenerationRequest ) : string {
511+ private generateTest ( prompt : string , _args : CodeGenerationRequest ) : string {
511512 const testName = this . extractTestName ( prompt ) || 'Functionality' ;
512513
513514 return `describe('${ testName } ', () => {
@@ -541,7 +542,7 @@ function functionToTest(input: any): any {
541542}` ;
542543 }
543544
544- private generateDocumentation ( prompt : string , args : CodeGenerationRequest ) : string {
545+ private generateDocumentation ( prompt : string , _args : CodeGenerationRequest ) : string {
545546 return `/**
546547 * ${ this . generateDocumentationTitle ( prompt ) }
547548 *
@@ -591,7 +592,7 @@ function functionToTest(input: any): any {
591592 return `Documentation for: ${ prompt } ` ;
592593 }
593594
594- private async validateGeneratedCode ( code : string , args : CodeGenerationRequest ) {
595+ private async validateGeneratedCode ( code : string , _args : CodeGenerationRequest ) {
595596 const validation = {
596597 syntax_valid : true ,
597598 potential_issues : [ ] as Array < {
@@ -646,7 +647,7 @@ function functionToTest(input: any): any {
646647 return validation ;
647648 }
648649
649- private async analyzeContextCompliance ( code : string , patterns : any , args : CodeGenerationRequest ) {
650+ private async analyzeContextCompliance ( code : string , patterns : any , _args : CodeGenerationRequest ) {
650651 const compliance = {
651652 matched_patterns : [ ] ,
652653 style_compliance : 0 ,
@@ -674,7 +675,7 @@ function functionToTest(input: any): any {
674675 return compliance ;
675676 }
676677
677- private async generateAlternatives ( args : CodeGenerationRequest , generatedCode : string , projectContext : any ) {
678+ private async generateAlternatives ( args : CodeGenerationRequest , generatedCode : string , _projectContext : any ) {
678679 const alternatives = [ ] ;
679680
680681 // Alternative implementation 1: More concise
@@ -700,7 +701,7 @@ function functionToTest(input: any): any {
700701 return alternatives ;
701702 }
702703
703- private async generateSuggestions ( code : string , validation : any , args : CodeGenerationRequest ) {
704+ private async generateSuggestions ( _code : string , _validation : any , _args : CodeGenerationRequest ) {
704705 return {
705706 alternative_implementations : [
706707 'Consider using functional programming patterns' ,
@@ -751,7 +752,7 @@ function functionToTest(input: any): any {
751752 return plan ;
752753 }
753754
754- private calculateConfidenceScore ( code : string , contextAnalysis : any , validation : any , args : CodeGenerationRequest ) : number {
755+ private calculateConfidenceScore ( code : string , contextAnalysis : any , validation : any , _args : CodeGenerationRequest ) : number {
755756 let score = 50 ; // Base score
756757
757758 // Add points for context compliance
0 commit comments