@@ -780,21 +780,13 @@ export default class BashServer {
780
780
start : declaration . range . start ,
781
781
scope : parent . range ,
782
782
} )
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
- } )
790
783
: null
791
784
if ( ranges ) {
792
785
return < LSP . WorkspaceEdit > {
793
786
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
+ ) ,
798
790
} ,
799
791
}
800
792
}
@@ -810,10 +802,7 @@ export default class BashServer {
810
802
kind : symbol . kind ,
811
803
start : declaration . range . start ,
812
804
} )
813
- . map ( ( range ) => ( {
814
- range,
815
- newText : params . newName ,
816
- } ) )
805
+ . map ( ( r ) => LSP . TextEdit . replace ( r , params . newName ) )
817
806
818
807
for ( const uri of this . analyzer . findAllConnectedUris ( declaration . uri ) ) {
819
808
edits . changes [ uri ] = this . analyzer
@@ -822,10 +811,7 @@ export default class BashServer {
822
811
word : symbol . word ,
823
812
kind : symbol . kind ,
824
813
} )
825
- . map ( ( range ) => ( {
826
- range,
827
- newText : params . newName ,
828
- } ) )
814
+ . map ( ( r ) => LSP . TextEdit . replace ( r , params . newName ) )
829
815
}
830
816
}
831
817
return edits
0 commit comments