@@ -71,16 +71,6 @@ export class IntrinsicFunctionArgumentCompletionProvider implements CompletionPr
7171 return undefined ;
7272 }
7373
74- log . debug (
75- {
76- provider : 'IntrinsicFunctionArgument' ,
77- context : context . record ( ) ,
78- intrinsicFunction : intrinsicFunction . type ,
79- args : intrinsicFunction . args ,
80- } ,
81- 'Processing intrinsic function argument completion request' ,
82- ) ;
83-
8474 // Route to specific handlers based on intrinsic function type
8575 switch ( intrinsicFunction . type ) {
8676 case IntrinsicFunction . Ref : {
@@ -106,14 +96,6 @@ export class IntrinsicFunctionArgumentCompletionProvider implements CompletionPr
10696 params : CompletionParams ,
10797 syntaxTree : SyntaxTree ,
10898 ) : CompletionItem [ ] | undefined {
109- log . debug (
110- {
111- provider : 'IntrinsicFunctionArgument' ,
112- function : 'Ref' ,
113- context : context . record ( ) ,
114- } ,
115- 'Processing Ref argument completion' ,
116- ) ;
11799 const parametersAndResourcesCompletions = this . getParametersAndResourcesAsCompletionItems (
118100 context ,
119101 params ,
@@ -135,14 +117,6 @@ export class IntrinsicFunctionArgumentCompletionProvider implements CompletionPr
135117 params : CompletionParams ,
136118 syntaxTree : SyntaxTree ,
137119 ) : CompletionItem [ ] | undefined {
138- log . debug (
139- {
140- provider : 'IntrinsicFunctionArgument' ,
141- function : 'Sub' ,
142- context : context . record ( ) ,
143- } ,
144- 'Processing Sub argument completion' ,
145- ) ;
146120 const parametersAndResourcesCompletions = this . getParametersAndResourcesAsCompletionItems (
147121 context ,
148122 params ,
@@ -193,34 +167,26 @@ export class IntrinsicFunctionArgumentCompletionProvider implements CompletionPr
193167 syntaxTree : SyntaxTree ,
194168 intrinsicFunction : IntrinsicFunctionInfo ,
195169 ) : CompletionItem [ ] | undefined {
196- log . debug (
197- { provider : 'FindInMap Completion' , context : context . record ( ) } ,
198- 'Processing FindInMap completion request' ,
199- ) ;
200-
201170 // Validate that mappings exist in the template
202171 const mappingsMap = getEntityMap ( syntaxTree , TopLevelSection . Mappings ) ;
203172 if ( ! mappingsMap || mappingsMap . size === 0 ) {
204- log . debug ( 'No mappings found in template for FindInMap completion' ) ;
205173 return undefined ;
206174 }
207175
208176 try {
209177 // Determine position in FindInMap arguments
210178 const position = this . determineFindInMapPosition ( intrinsicFunction . args , context ) ;
211- log . debug ( `FindInMap argument position determined: ${ position } ` ) ;
212179
213180 // Get completions based on position
214181 const completions = this . getCompletionsByPosition ( position , mappingsMap , intrinsicFunction . args , context ) ;
215182
216183 if ( ! completions ) {
217- log . debug ( `No completions found for FindInMap position ${ position } ` ) ;
218184 return undefined ;
219185 }
220186
221187 return completions ;
222188 } catch ( error ) {
223- log . error ( { error } , 'Error processing FindInMap completions' ) ;
189+ log . error ( error , 'Error processing FindInMap completions' ) ;
224190 return undefined ;
225191 }
226192 }
@@ -362,7 +328,7 @@ export class IntrinsicFunctionArgumentCompletionProvider implements CompletionPr
362328 attributeDescription = resolvedSchemas [ 0 ] . description ;
363329 }
364330 } catch ( error ) {
365- log . error ( { error } , 'Error resolving JSON Pointer path' ) ;
331+ log . error ( error , 'Error resolving JSON pointer path' ) ;
366332 }
367333 }
368334 completionItems . push (
@@ -461,7 +427,6 @@ export class IntrinsicFunctionArgumentCompletionProvider implements CompletionPr
461427 ) : CompletionItem [ ] | undefined {
462428 // Validate position is within expected range for FindInMap (1-3)
463429 if ( position < 1 || position > 3 ) {
464- log . debug ( `Invalid FindInMap position: ${ position } ` ) ;
465430 return undefined ;
466431 }
467432
@@ -489,7 +454,7 @@ export class IntrinsicFunctionArgumentCompletionProvider implements CompletionPr
489454
490455 return context . text . length > 0 ? this . fuzzySearch ( items , context . text ) : items ;
491456 } catch ( error ) {
492- log . error ( { error } , 'Error creating mapping name completions' ) ;
457+ log . error ( error , 'Error creating mapping name completions' ) ;
493458 return [ ] ;
494459 }
495460 }
@@ -501,21 +466,18 @@ export class IntrinsicFunctionArgumentCompletionProvider implements CompletionPr
501466 ) : CompletionItem [ ] | undefined {
502467 // Validate arguments structure
503468 if ( ! Array . isArray ( args ) || args . length === 0 || typeof args [ 0 ] !== 'string' ) {
504- log . debug ( 'Invalid arguments for top-level key completions' ) ;
505469 return undefined ;
506470 }
507471
508472 try {
509473 const mappingName = args [ 0 ] ;
510474 const mappingEntity = this . getMappingEntity ( mappingsEntities , mappingName ) ;
511475 if ( ! mappingEntity ) {
512- log . debug ( `Mapping entity not found: ${ mappingName } ` ) ;
513476 return undefined ;
514477 }
515478
516479 const topLevelKeys = mappingEntity . getTopLevelKeys ( ) ;
517480 if ( topLevelKeys . length === 0 ) {
518- log . debug ( `No top-level keys found for mapping: ${ mappingName } ` ) ;
519481 return undefined ;
520482 }
521483
@@ -525,7 +487,7 @@ export class IntrinsicFunctionArgumentCompletionProvider implements CompletionPr
525487
526488 return context . text . length > 0 ? this . fuzzySearch ( items , context . text ) : items ;
527489 } catch ( error ) {
528- log . error ( { error } , 'Error creating top-level key completions' ) ;
490+ log . error ( error , 'Error creating top-level key completions' ) ;
529491 return undefined ;
530492 }
531493 }
@@ -537,7 +499,6 @@ export class IntrinsicFunctionArgumentCompletionProvider implements CompletionPr
537499 ) : CompletionItem [ ] | undefined {
538500 // Validate arguments structure for second-level keys
539501 if ( ! this . isValidSecondLevelKeyArgs ( args ) ) {
540- log . debug ( 'Invalid arguments for second-level key completions' ) ;
541502 return undefined ;
542503 }
543504
@@ -547,13 +508,11 @@ export class IntrinsicFunctionArgumentCompletionProvider implements CompletionPr
547508
548509 const mappingEntity = this . getMappingEntity ( mappingsEntities , mappingName ) ;
549510 if ( ! mappingEntity ) {
550- log . debug ( `Mapping entity not found: ${ mappingName } ` ) ;
551511 return undefined ;
552512 }
553513
554514 const secondLevelKeys = this . getSecondLevelKeysForTopLevelKey ( mappingEntity , topLevelKey ) ;
555515 if ( secondLevelKeys . length === 0 ) {
556- log . debug ( `No second-level keys found for mapping: ${ mappingName } ` ) ;
557516 return undefined ;
558517 }
559518
@@ -563,7 +522,7 @@ export class IntrinsicFunctionArgumentCompletionProvider implements CompletionPr
563522
564523 return this . filterSecondLevelKeyItems ( items , context , topLevelKey ) ;
565524 } catch ( error ) {
566- log . debug ( { error } , 'Error creating second-level key completions' ) ;
525+ log . warn ( error , 'Error creating second-level key completions' ) ;
567526 return undefined ;
568527 }
569528 }
@@ -647,7 +606,7 @@ export class IntrinsicFunctionArgumentCompletionProvider implements CompletionPr
647606 }
648607 return mappingContext . entity as Mapping ;
649608 } catch ( error ) {
650- log . error ( { error } , `Error retrieving mapping entity: ${ mappingName } ` ) ;
609+ log . error ( error , `Error retrieving mapping entity: ${ mappingName } ` ) ;
651610 return undefined ;
652611 }
653612 }
0 commit comments