@@ -780,21 +780,13 @@ export default class BashServer {
780780 start : declaration . range . start ,
781781 scope : parent . range ,
782782 } )
783- : declaration . uri === params . textDocument . uri
784- ? this . analyzer . findOccurrencesWithin ( {
785- uri : params . textDocument . uri ,
786- word : symbol . word ,
787- kind : symbol . kind ,
788- start : declaration . range . start ,
789- } )
790783 : null
791784 if ( ranges ) {
792785 return < LSP . WorkspaceEdit > {
793786 changes : {
794- [ params . textDocument . uri ] : ranges . map ( ( range ) => ( {
795- range,
796- newText : params . newName ,
797- } ) ) ,
787+ [ params . textDocument . uri ] : ranges . map ( ( r ) =>
788+ LSP . TextEdit . replace ( r , params . newName ) ,
789+ ) ,
798790 } ,
799791 }
800792 }
@@ -810,10 +802,7 @@ export default class BashServer {
810802 kind : symbol . kind ,
811803 start : declaration . range . start ,
812804 } )
813- . map ( ( range ) => ( {
814- range,
815- newText : params . newName ,
816- } ) )
805+ . map ( ( r ) => LSP . TextEdit . replace ( r , params . newName ) )
817806
818807 for ( const uri of this . analyzer . findAllConnectedUris ( declaration . uri ) ) {
819808 edits . changes [ uri ] = this . analyzer
@@ -822,10 +811,7 @@ export default class BashServer {
822811 word : symbol . word ,
823812 kind : symbol . kind ,
824813 } )
825- . map ( ( range ) => ( {
826- range,
827- newText : params . newName ,
828- } ) )
814+ . map ( ( r ) => LSP . TextEdit . replace ( r , params . newName ) )
829815 }
830816 }
831817 return edits
0 commit comments