TabNine的免费版已经足够好用了,但是在超过400kb的项目中,它总是通过 company 来提示我升级付费版本。
今天写了一小段代码让 company 不要烦我:
;; The free version of TabNine is good enough,
;; and below code is recommended that TabNine not always
;; prompt me to purchase a paid version in a large project.
(defadvice company-echo-show (around disable-tabnine-upgrade-message activate)
(let ((company-message-func (ad-get-arg 0)))
(when (and company-message-func
(stringp (funcall company-message-func)))
(unless (string-match "The free version of TabNine only indexes up to" (funcall company-message-func))
ad-do-it))))
加上上面代码, TabNine 就专心的干活,不会一直在那里烦人了。