The `rtags-apply-fixit-at-point' function doesn't work. To test, compile a c++ file with -Weverything, then use NULL (it should be nullptr). There will be a fixit shown using the rtags-fixitline face. Running rtags-apply-fixit-at-point when point is on the NULL will do nothing.
I glanced at the code and don't see how it could work:
(defun rtags-apply-fixit-at-point ()
(interactive)
(let ((line (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
(when (string-match "^\\(.*\\):[0-9]+:[0-9]+: fixit: \\([0-9]+\\)-\\([0-9]+\\): .*did you mean '\\(.*\\)'\\?$" line)
line is content from the file.cpp and not the clang diagnostic. Also, elsewhere in rtags.el the 'did you mean' was stripped from the message.
It would also be good to keep the 'did you mean' in the diagnostic message when shown by rtags-diagnostics (this makes it easier to read the message).
Hey @JohnC32, rtags-fix-fixit-at-point is the function doing the work, and is now (again) bound to C-c r X. I removed rtags-apply-fixit-at-point completely.
Please mark appropriate
Problem description
The `rtags-apply-fixit-at-point' function doesn't work. To test, compile a c++ file with -Weverything, then use NULL (it should be nullptr). There will be a fixit shown using the rtags-fixitline face. Running rtags-apply-fixit-at-point when point is on the NULL will do nothing.
I glanced at the code and don't see how it could work:
line is content from the file.cpp and not the clang diagnostic. Also, elsewhere in rtags.el the 'did you mean' was stripped from the message.
It would also be good to keep the 'did you mean' in the diagnostic message when shown by rtags-diagnostics (this makes it easier to read the message).
Expected behavior
Running `rtags-apply-fixit-at-point' should work.
Actual behavior
Fixit is not applied.
Environment
Your operating system: Debian 8.
LLVM/Clang version: 5.0