lyuts / vim-rtags

Vim bindings for rtags, llvm/clang based c++ code indexer.
BSD 2-Clause "Simplified" License
282 stars 56 forks source link

class rename destructor issue #32

Closed pdavydov108 closed 8 years ago

pdavydov108 commented 8 years ago

Hello @lyuts , I've noticed a weird issue with rename. When I try to change a class name with rw, and then type 'a' to rename it everywhere, destructor is not renamed correctly. I'm not sure if it's an issue with plugin or with rtags itself, but instead of renaming virtual ~MyClass() = default; to virtual ~NewName() = default; it produces virtual NewNameMyClass() = default;. All other symbols are renamed correctly.

asenac commented 8 years ago

The location returned with "rc -e --rename -r" for destructors points to the ~ character. I guess this is not a bug in RTags as Rtags' emacs plugin takes this into account when renaming https://github.com/Andersbakken/rtags/blob/master/src/rtags.el#L2275. I guess vim-rtags should do the same.

pdavydov108 commented 8 years ago

@asenac Thanks for fixing it! I thought that the issue might be with location pointing to '~', but had no time to check it. Again, thanks, this fix will make my daily job easier!

lyuts commented 8 years ago

Pull request from @asenac has been merged. Closing this issue.