aboutsummaryrefslogtreecommitdiff
path: root/hcel-haddorg.el
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-10-05 10:32:41 +1100
committerYuchen Pei <hi@ypei.me>2022-10-05 10:32:41 +1100
commit3de0aca80d056901b4c355942e33581ec3ce7acb (patch)
tree24d31a759efbec579430f1acc64e90bd43b5e61b /hcel-haddorg.el
parentdfa70bf16724a5a29e054af89fcf126438181e38 (diff)
clarifying names w.r.t identifiers
- identifier should refer to an IdentifierInfo type on server - internal-id <-> InternalId - external-id <-> ExternalId
Diffstat (limited to 'hcel-haddorg.el')
-rw-r--r--hcel-haddorg.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/hcel-haddorg.el b/hcel-haddorg.el
index a6961cc..0453f1d 100644
--- a/hcel-haddorg.el
+++ b/hcel-haddorg.el
@@ -58,14 +58,15 @@ is in ghc-8.10.1, hcel will attempt to look up in ghc-9.2.2.org."
(defun hcel-identifier-at-point-to-haddorg ()
(interactive)
- (when-let* ((identifier (hcel-text-property-near-point 'identifier))
- (id (alist-get (intern identifier) hcel-identifiers))
- (exported (alist-get 'isExported id))
- (external-id (alist-get 'externalId id)))
+ (when-let* ((internal-id (hcel-text-property-near-point 'internal-id))
+ (identifier (alist-get (intern internal-id) hcel-identifiers))
+ (exported (alist-get 'isExported identifier))
+ (external-id (alist-get 'externalId identifier)))
(if (and (eq exported json-false)
;; FIXME: Hacky. ExactLocation implies identifier is declared in
;; the current module.
- (equal (alist-get 'tag (alist-get 'locationInfo id)) "ExactLocation"))
+ (equal (alist-get 'tag (alist-get 'locationInfo identifier))
+ "ExactLocation"))
(message "%s is not exported." (hcel-occ-symbol-at-point))
(let* ((splitted (split-string external-id "|"))
(package-id (car splitted))