leoliu/ggtags

Make integration with xref and capf user configurable

Opened this issue · 0 comments

BooAA commented

Hi, thanks for the awesome work that makes me more productive everyday.

I'm asking if we can make the integration with xref and capf user configurable options? Since I'm using many similar packages (gtags, cscope, eglot, etc), I don't want each of them adding itself into the xref/capf backend list that might conflict with each other. Currently I'm using a hack to just remove those backend when ggtags-mode is enable. E.g.

(add-hook 'ggtags-mode 
          (lambda ()
            (remove-hook 'xref-backend-functions 'ggtags--xref-backend t)
            (remove-hook 'completion-at-point-functions #'ggtags-completion-at-point t)))

And it works for me without noticeable issue. Base on this, my naive assumption will be that we just need to provide some defcustoms and check the value in https://github.com/leoliu/ggtags/blob/master/ggtags.el#L2209 for whether we are going to enable xref/cape integration or not? I'm not an elisp expert so I'm might be wrong. What do you think?