diff --git a/autoload/go/rename.vim b/autoload/go/rename.vim index 12c6fe413e..9b28641d63 100644 --- a/autoload/go/rename.vim +++ b/autoload/go/rename.vim @@ -23,7 +23,7 @@ function! go#rename#Rename(bang, ...) abort let l:bin = go#config#RenameCommand() " return with a warning if the bin doesn't exist - let bin_path = go#path#CheckBinPath(l:bin) + let bin_path = go#path#CheckBinPath(substitute(l:bin, 'gopls rename$', 'gopls', '')) if empty(bin_path) return endif @@ -40,6 +40,8 @@ function! go#rename#Rename(bang, ...) abort let args = [] if l:bin == 'gorename' let l:args = extend(l:args, ['-tags', go#config#BuildTags(), '-offset', offset, '-to', to_identifier]) + else if l:bin == 'gopls rename' + let l:args = extend(l:args, ['rename', offset, to_identifier]) else call go#util#EchoWarning('unexpected rename command') endif diff --git a/doc/vim-go.txt b/doc/vim-go.txt index a278bb1af0..a47d1f1cc1 100644 --- a/doc/vim-go.txt +++ b/doc/vim-go.txt @@ -1676,7 +1676,7 @@ default it is set to edit. *'g:go_rename_command'* Use this option to define which tool is used to rename. By default `gopls` -is used. Valid options are `gorename` and `gopls`. +is used. Valid options are `gopls`, `gopls rename`, and `gorename`. > let g:go_rename_command = 'gopls' <