aboutsummaryrefslogtreecommitdiff
path: root/hcel-results.el
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-09-19 13:11:22 +1000
committerYuchen Pei <hi@ypei.me>2022-09-19 13:11:22 +1000
commit3da82c44a4a6ed7e3760fe2e9d37ebf2cfd669d1 (patch)
tree73b135b8d0dbe7330492e4c91455ad8143dcbb0e /hcel-results.el
parentc14271c3732f02ae391c3847ed7a687171ef4013 (diff)
find definition / references / eldoc now look at previous point too.
Diffstat (limited to 'hcel-results.el')
-rw-r--r--hcel-results.el28
1 files changed, 14 insertions, 14 deletions
diff --git a/hcel-results.el b/hcel-results.el
index 5f27b6a..06eddbb 100644
--- a/hcel-results.el
+++ b/hcel-results.el
@@ -23,6 +23,7 @@
;; compilation-mode.
;;; Code:
+(require 'hcel-utils)
(defun hcel-results-next-error-no-open (n)
(interactive "p")
@@ -202,24 +203,23 @@ Start by choosing a package."
"Find references of the identifier at point."
(interactive)
(hcel-find-references-internal hcel-package-id hcel-module-path
- (get-text-property (point) 'identifier)))
+ (hcel-text-property-near-point 'identifier)))
(define-key hcel-mode-map (kbd "M-?") 'hcel-find-references-at-point)
(defun hcel-minor-find-references-at-point ()
(interactive)
- (let ((props (text-properties-at (point))))
- (cond ((or (eq major-mode 'hcel-outline-mode)
- (eq (current-buffer) eldoc--doc-buffer))
- (hcel-find-references-internal
- (plist-get props 'package-id)
- (plist-get props 'module-path)
- (plist-get props 'internal-id)))
- ((eq major-mode 'hcel-ids-mode)
- (hcel-find-references-internal
- (alist-get 'packageId (plist-get props 'location-info))
- (alist-get 'modulePath (plist-get props 'location-info))
- (plist-get props 'internal-id)))
- (t (error "%S not supported and not in eldoc doc buffer." major-mode)))))
+ (cond ((or (eq major-mode 'hcel-outline-mode)
+ (eq (current-buffer) eldoc--doc-buffer))
+ (hcel-find-references-internal
+ (hcel-text-property-near-point 'package-id)
+ (hcel-text-property-near-point 'module-path)
+ (hcel-text-property-near-point 'internal-id)))
+ ((eq major-mode 'hcel-ids-mode)
+ (hcel-find-references-internal
+ (alist-get 'packageId (hcel-text-property-near-point 'location-info))
+ (alist-get 'modulePath (hcel-text-property-near-point 'location-info))
+ (hcel-text-property-near-point 'internal-id)))
+ (t (error "%S not supported and not in eldoc doc buffer." major-mode))))
(defun hcel-find-references-internal (package-id module-path identifier)
(when (and package-id module-path identifier)