Skip to content

Commit

Permalink
Add function documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
xvw committed Sep 19, 2024
1 parent a4a8b82 commit 4a40993
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion emacs/merlin.el
Original file line number Diff line number Diff line change
Expand Up @@ -1130,9 +1130,10 @@ An ocaml atom is any string containing [a-z_0-9A-Z`.]."
function-type)))))

(defun merlin-search-by-type (query)
"Search a value definition by type expression"
(interactive "sSearch query: ")
(let ((entries (merlin--search-by-type query))
(previous-buff (current-buffer)))
(previous-buff (current-buffer)))
(let ((search-by-type-buffer (merlin--get-search-by-type-result-buff))
(inhibit-read-only t))
(with-current-buffer search-by-type-buffer
Expand Down Expand Up @@ -1168,6 +1169,7 @@ An ocaml atom is any string containing [a-z_0-9A-Z`.]."
(vector (merlin--render-search-result function-name function-type)))))

(defun merlin-search-by-polarity (query)
"Search a value definition by polarity"
(interactive "sSearch query: ")
(let* ((result (merlin--search query))
(entries (cdr (assoc 'entries result)))
Expand All @@ -1192,6 +1194,7 @@ An ocaml atom is any string containing [a-z_0-9A-Z`.]."
(or (string-prefix-p "-" query) (string-prefix-p "+" query)))

(defun merlin-search (query)
"Search a value defintion by polarity or by type expression"
(interactive "sSearch query: ")
(if (merlin--is-polarity-query query)
(merlin-search-by-polarity query)
Expand Down

0 comments on commit 4a40993

Please sign in to comment.