mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Add lookup-documentation handler for cmake-mode
Closes #4277 Co-authored-by: Sam Whitlock <samwhitlock@users.noreply.github.com>
This commit is contained in:
@ -156,6 +156,18 @@ the children of class at point."
|
||||
do (push (cons (1+ depth) child) tree)))))))
|
||||
(eglot--error "Hierarchy unavailable")))
|
||||
|
||||
;;;###autoload
|
||||
(defun +cc-cmake-lookup-documentation-fn (_)
|
||||
"Look up the symbol at point in CMake's documentation."
|
||||
(condition-case _
|
||||
(progn
|
||||
(save-window-excursion (cmake-help))
|
||||
(when-let (buf (get-buffer "*CMake Help*"))
|
||||
(pop-to-buffer buf)
|
||||
t))
|
||||
(error nil)))
|
||||
|
||||
|
||||
;;
|
||||
;; Hooks
|
||||
|
||||
|
@ -154,7 +154,10 @@ This is ignored by ccls.")
|
||||
;; Major modes
|
||||
|
||||
(after! cmake-mode
|
||||
(set-docsets! 'cmake-mode "CMake"))
|
||||
(set-docsets! 'cmake-mode "CMake")
|
||||
(set-popup-rule! "^\\*CMake Help\\*" :size 0.4 :ttl t)
|
||||
(set-lookup-handlers! 'cmake-mode
|
||||
:documentation '+cc-cmake-lookup-documentation-fn))
|
||||
|
||||
(use-package! company-cmake ; for `cmake-mode'
|
||||
:when (featurep! :completion company)
|
||||
|
Reference in New Issue
Block a user