@@ -509,7 +509,7 @@ suite('Extension Tests', async () => {
509509 const editor = await vscode . window . showTextDocument ( uri , showTextDocumentOptions ) ;
510510
511511 type RenamePrepare = /* vscode.Range | */ {
512- range : vscode . Range ;
512+ range : IRange ;
513513 text : string ;
514514 } ;
515515 interface WorkspaceEdit {
@@ -528,6 +528,7 @@ suite('Extension Tests', async () => {
528528 text : string ;
529529 // eol?: model.EndOfLineSequence;
530530 }
531+ /* One indexed */
531532 interface IRange {
532533 readonly startLineNumber : number ;
533534 readonly startColumn : number ;
@@ -553,18 +554,16 @@ suite('Extension Tests', async () => {
553554 const position = typeof positionOrLine == 'number' ? new vscode . Position ( positionOrLine , character ! ) : positionOrLine ;
554555 const renamePrepare = await tryCatchAsync ( vscode . commands . executeCommand ( '_executePrepareRename' , uri , position ) ) as RenamePrepare | undefined ;
555556 if ( typeof character == 'number' ) {
556- assert . ok ( renamePrepare ) ;
557+ assert . ok ( renamePrepare , `Rename assertion fail at ${ uri . fsPath } : ${ position . line + 1 } : ${ position . character } ${ newName ? ` newName: ' ${ newName } '` : '' } ` ) ;
557558 }
558- else {
559- if ( ! renamePrepare ) {
560- return ;
561- }
559+ else if ( ! renamePrepare ) {
560+ return ;
562561 }
563562
564563 if ( ! renamePrepare . text ) {
565- console . log ( JSON . stringify ( renamePrepare ) ) ;
564+ console . warn ( "Empty Rename:" , JSON . stringify ( position ) , JSON . stringify ( renamePrepare ) ) ;
566565 }
567- newName = newName || renamePrepare . text . split ( '' ) . reverse ( ) . join ( '' ) ;
566+ newName ||= renamePrepare . text . split ( '' ) . reverse ( ) . join ( '' ) ;
568567 const workspaceEdit = await vscode . commands . executeCommand ( '_executeDocumentRenameProvider' , uri , position , newName ) as WorkspaceEdit ;
569568 const workspaceEdits = workspaceEdit . edits ;
570569
@@ -588,7 +587,7 @@ suite('Extension Tests', async () => {
588587
589588 await assertStrings ( editor , assertRename ) ;
590589
591- await assertRename ( 18 , 7 , "LogicalBinary" ) ;
590+ await assertRename ( 20 , 7 , "LogicalBinary" ) ;
592591
593592 await assertBaseline ( renamesActual , 'RenameProvider.json' ) ;
594593
@@ -629,7 +628,7 @@ suite('Extension Tests', async () => {
629628
630629 await assertStrings ( editor , assertDefinition ) ;
631630
632- await assertDefinition ( 21 , 31 ) ;
631+ await assertDefinition ( 23 , 31 ) ;
633632
634633 await assertBaseline ( definitionsActual , 'DefinitionReferenceProvider.json' ) ;
635634 } ) ;
0 commit comments