@@ -8,7 +8,7 @@ export const outputChannel = vscode.window.createOutputChannel('IAM Action Snipp
8
8
9
9
export function log ( message : string ) {
10
10
if ( DEBUG_ENABLED ) {
11
- outputChannel . appendLine ( message ) ;
11
+ outputChannel . appendLine ( `[DEBUG] ${ message } ` ) ;
12
12
}
13
13
}
14
14
@@ -363,12 +363,12 @@ async function isBelowActionKey(document: vscode.TextDocument, position: vscode.
363
363
const currentLineIndex = position . line ;
364
364
const currentLine = allLines [ currentLineIndex ] || '' ;
365
365
const currentIndent = currentLine . search ( / \S / ) ;
366
- log ( `[DEBUG] [ YAML] Current line (${ currentLineIndex } ): ${ currentLine } ` ) ;
367
- log ( `[DEBUG] [ YAML] Current indent: ${ currentIndent } ` ) ;
366
+ log ( `[YAML] Current line (${ currentLineIndex } ): ${ currentLine } ` ) ;
367
+ log ( `[YAML] Current indent: ${ currentIndent } ` ) ;
368
368
369
369
// If the current line itself is a key, disable autocomplete.
370
370
if ( / ^ [ - \s ] * \w + \s * : / . test ( currentLine ) ) {
371
- log ( '[DEBUG] [ YAML] Current line appears to be a key, disabling autocomplete' ) ;
371
+ log ( '[YAML] Current line appears to be a key, disabling autocomplete' ) ;
372
372
return false ;
373
373
}
374
374
@@ -382,18 +382,18 @@ async function isBelowActionKey(document: vscode.TextDocument, position: vscode.
382
382
if ( ! line . includes ( ':' ) ) {
383
383
continue ;
384
384
}
385
- log ( `[DEBUG] [ YAML] Scanning line ${ i } : ${ line } ` ) ;
385
+ log ( `[YAML] Scanning line ${ i } : ${ line } ` ) ;
386
386
const match = line . match ( / ^ ( [ \t ] * ) (?: - \s * ) ? ( \w + ) \s * : / ) ;
387
387
if ( match ) {
388
388
const parentIndent = match [ 1 ] . length ;
389
389
if ( parentIndent < currentIndent ) {
390
390
const parentKey = match [ 2 ] . toLowerCase ( ) ;
391
- log ( `[DEBUG] [ YAML] Found parent key: ${ parentKey } at indent: ${ parentIndent } ` ) ;
391
+ log ( `[YAML] Found parent key: ${ parentKey } at indent: ${ parentIndent } ` ) ;
392
392
if ( parentKey === 'action' ) {
393
- log ( `[DEBUG] [ YAML] Position is under 'action' key, enabling autocomplete` ) ;
393
+ log ( `[YAML] Position is under 'action' key, enabling autocomplete` ) ;
394
394
return true ;
395
395
}
396
- log ( `[DEBUG] [ YAML] Parent key is not 'action', stopping search.` ) ;
396
+ log ( `[YAML] Parent key is not 'action', stopping search.` ) ;
397
397
break ;
398
398
}
399
399
}
@@ -406,18 +406,18 @@ async function isBelowActionKey(document: vscode.TextDocument, position: vscode.
406
406
const currentLineIndex = position . line ;
407
407
const currentLine = allLines [ currentLineIndex ] || '' ;
408
408
const currentIndent = currentLine . search ( / \S / ) ;
409
- log ( `[DEBUG] [ TS] Current line (${ currentLineIndex } ): ${ currentLine } ` ) ;
410
- log ( `[DEBUG] [ TS] Current indent: ${ currentIndent } ` ) ;
409
+ log ( `[TS] Current line (${ currentLineIndex } ): ${ currentLine } ` ) ;
410
+ log ( `[TS] Current indent: ${ currentIndent } ` ) ;
411
411
412
412
const actionsRegex = / a c t i o n s \s * : \s * \[ / ;
413
413
for ( let i = currentLineIndex ; i >= 0 ; i -- ) {
414
414
const line = allLines [ i ] ;
415
- log ( `[DEBUG] [ TS] Scanning line ${ i } : ${ line } ` ) ;
415
+ log ( `[TS] Scanning line ${ i } : ${ line } ` ) ;
416
416
if ( actionsRegex . test ( line ) ) {
417
417
const match = line . match ( / ^ ( \s * ) / ) ;
418
418
const parentIndent = match ? match [ 1 ] . length : 0 ;
419
419
if ( currentIndent > parentIndent ) {
420
- log ( `[DEBUG] [ TS] Found actions array starting at line ${ i } , enabling autocomplete` ) ;
420
+ log ( `[TS] Found actions array starting at line ${ i } , enabling autocomplete` ) ;
421
421
return true ;
422
422
}
423
423
break ;
@@ -431,18 +431,18 @@ async function isBelowActionKey(document: vscode.TextDocument, position: vscode.
431
431
const currentLineIndex = position . line ;
432
432
const currentLine = allLines [ currentLineIndex ] || '' ;
433
433
const currentIndent = currentLine . search ( / \S / ) ;
434
- log ( `[DEBUG] [ Python] Current line (${ currentLineIndex } ): ${ currentLine } ` ) ;
435
- log ( `[DEBUG] [ Python] Current indent: ${ currentIndent } ` ) ;
434
+ log ( `[Python] Current line (${ currentLineIndex } ): ${ currentLine } ` ) ;
435
+ log ( `[Python] Current indent: ${ currentIndent } ` ) ;
436
436
437
437
const actionsRegex = / a c t i o n s \s * = \s * \[ / ;
438
438
for ( let i = currentLineIndex ; i >= 0 ; i -- ) {
439
439
const line = allLines [ i ] ;
440
- log ( `[DEBUG] [ Python] Scanning line ${ i } : ${ line } ` ) ;
440
+ log ( `[Python] Scanning line ${ i } : ${ line } ` ) ;
441
441
if ( actionsRegex . test ( line ) ) {
442
442
const match = line . match ( / ^ ( \s * ) / ) ;
443
443
const parentIndent = match ? match [ 1 ] . length : 0 ;
444
444
if ( currentIndent > parentIndent ) {
445
- log ( `[DEBUG] [ Python] Found actions list starting at line ${ i } , enabling autocomplete` ) ;
445
+ log ( `[Python] Found actions list starting at line ${ i } , enabling autocomplete` ) ;
446
446
return true ;
447
447
}
448
448
break ;
0 commit comments