@@ -737,31 +737,14 @@ export default class BashServer {
737
737
return null
738
738
}
739
739
740
- if ( Builtins . isBuiltin ( symbol . word ) ) {
741
- this . throwResponseError ( 'You cannot rename a built-in command.' )
742
- }
743
-
744
- if ( this . executables . isExecutableOnPATH ( symbol . word ) ) {
745
- this . throwResponseError ( 'You cannot rename an executable.' )
746
- }
747
-
748
- if ( ReservedWords . isReservedWord ( symbol . word ) ) {
749
- this . throwResponseError ( 'You cannot rename a reserved word.' )
750
- }
751
-
752
740
return symbol . range
753
741
}
754
742
755
743
private onRenameRequest ( params : LSP . RenameParams ) : LSP . WorkspaceEdit | null {
756
744
const symbol = this . analyzer . symbolAtPointFromTextPosition ( params )
757
745
this . logRequest ( { request : 'onRenameRequest' , params, word : symbol ?. word } )
758
746
759
- if (
760
- ! symbol ||
761
- Builtins . isBuiltin ( symbol . word ) ||
762
- this . executables . isExecutableOnPATH ( symbol . word ) ||
763
- ReservedWords . isReservedWord ( symbol . word )
764
- ) {
747
+ if ( ! symbol ) {
765
748
return null
766
749
}
767
750
@@ -805,8 +788,8 @@ export default class BashServer {
805
788
declaration . range . start ,
806
789
declaration . range . end ,
807
790
)
808
- // If the symbol is a function, `parentScope` should be a subshell not the
809
- // function definition itself.
791
+ // If the symbol is a function, `parentScope` should be a parent function or
792
+ // a subshell, not the function definition itself.
810
793
if ( parentScope ?. type === symbol . type ) {
811
794
parentScope = this . analyzer . findParentScope (
812
795
params . textDocument . uri ,
0 commit comments