From 1699e7873395703720c607a0254909aece16bae7 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Fri, 23 Sep 2022 16:45:36 +1000 Subject: Separating out hcel-minor mode to avoid recursive requires --- hcel-client.el | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'hcel-client.el') 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 -- cgit v1.2.3