@@ -45,6 +45,14 @@ interface TypeMismatch {
4545 paramsType : string [ ] ;
4646}
4747
48+ /**
49+ * Parameter information with direction
50+ */
51+ interface ParameterInfo {
52+ name : string ;
53+ direction : Direction ;
54+ }
55+
4856/**
4957 * Validation result for variant parameters
5058 */
@@ -102,19 +110,36 @@ export class SyntaxChecker {
102110 }
103111
104112 /**
105- * Extract actual parameter names from parameter array
113+ * Extract actual parameter names and directions from parameter array
114+ * @param params - Parameter array from documentation
115+ * @returns Array of parameter info with names and directions
116+ */
117+ extractActualParamNames ( params : DocumentationParameter [ ] ) : ParameterInfo [ ] {
118+ if ( ! params || params . length === 0 ) return [ ] ;
119+
120+ return params
121+ . filter ( param => param . direction !== undefined ) // Only include params with valid direction
122+ . map ( param => ( {
123+ name : param . name . toLowerCase ( ) ,
124+ direction : param . direction !
125+ } ) ) ;
126+ }
127+
128+ /**
129+ * Get input parameter names (excluding return parameters)
106130 * @param params - Parameter array from documentation
107- * @returns Array of parameter names
131+ * @returns Array of input parameter names
108132 */
109- extractActualParamNames ( params : DocumentationParameter [ ] ) : string [ ] {
133+ getInputParameterNames ( params : DocumentationParameter [ ] ) : string [ ] {
110134 if ( ! params || params . length === 0 ) return [ ] ;
111135
112136 return params
113137 . filter ( param => {
114138 const name = param . name ;
115139 const direction = param . direction ;
116- // Only include input and input/output parameters, exclude return parameters
140+ // Only include parameters with valid direction, and exclude return parameters
117141 return (
142+ direction !== undefined &&
118143 direction !== Direction . Return &&
119144 name !== 'Function result'
120145 ) ;
@@ -402,7 +427,8 @@ export class SyntaxChecker {
402427
403428 // Check if there are any errors/warnings
404429 let hasErrors = false ;
405- const actualParamNames = params && params . length > 0 ? this . extractActualParamNames ( params ) : [ ] ;
430+ const actualParamNames = params && params . length > 0 ? this . getInputParameterNames ( params ) : [ ] ;
431+ const allParamInfo = params && params . length > 0 ? this . extractActualParamNames ( params ) : [ ] ;
406432
407433 // Check each parsed variant for issues (malformations and parameter errors)
408434 parsedParams . forEach ( ( variant ) => {
@@ -421,6 +447,7 @@ export class SyntaxChecker {
421447 console . log ( '\nActual Params:' , JSON . stringify ( params , null , 2 ) ) ;
422448
423449 console . log ( 'Expected parameter names:' , actualParamNames ) ;
450+ console . log ( 'All parameter info:' , allParamInfo . map ( p => `${ p . name } (direction: ${ p . direction } )` ) ) ;
424451
425452 // Check each parsed variant
426453 parsedParams . forEach ( ( variant , index ) => {
@@ -456,6 +483,7 @@ export class SyntaxChecker {
456483 case '->' : return Direction . In ;
457484 case '←' :
458485 case '<-' : return Direction . Return ;
486+ case '↔' :
459487 case '<->' : return Direction . IO ;
460488 }
461489 return undefined ;
0 commit comments