aboutsummaryrefslogtreecommitdiff
path: root/hcel-client.el
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-09-23 16:45:36 +1000
committerYuchen Pei <hi@ypei.me>2022-09-23 16:45:36 +1000
commit1699e7873395703720c607a0254909aece16bae7 (patch)
tree5129ba34dfc33ee6c3f5e99e8a43b73ecdb3fccd /hcel-client.el
parentf73cbee6f83f948202d0ea3fb8775b49562295be (diff)
Separating out hcel-minor mode to avoid recursive requires
Diffstat (limited to 'hcel-client.el')
-rw-r--r--hcel-client.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/hcel-client.el b/hcel-client.el
index 3af6882..532fc88 100644
--- a/hcel-client.el
+++ b/hcel-client.el
@@ -68,6 +68,26 @@
(name (alist-get 'name approx-location-info)))
(hcel-api-definition-site package-id component-id module-name entity name)))
+(defun hcel-approx-to-exact-location (approx-location-info)
+ "Fetch exact location given approximate location.
+
+Example of approximate location:
+
+ \"locationInfo\": {
+ \"componentId\": \"exe-haskell-code-server\",
+ \"entity\": \"Typ\",
+ \"haddockAnchorId\": \"PackageInfo\",
+ \"moduleName\": \"HaskellCodeExplorer.Types\",
+ \"name\": \"PackageInfo\",
+ \"packageId\": {
+ \"name\": \"haskell-code-explorer\",
+ \"version\": \"0.1.0.0\"
+ },
+ \"tag\": \"ApproximateLocation\"
+ }"
+ (alist-get 'location
+ (hcel-definition-site-location-info approx-location-info)))
+
(defun hcel-api-module-info (package-id module-path)
(hcel-url-fetch-json
(concat