Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Unknown restclient hook type jq-set-var With Latest Version #282

Open
tompurl opened this issue Jun 1, 2022 · 4 comments
Open

Unknown restclient hook type jq-set-var With Latest Version #282

tompurl opened this issue Jun 1, 2022 · 4 comments

Comments

@tompurl
Copy link

tompurl commented Jun 1, 2022

I'm using Doom emacs. The pinned version is a few commits behind so I added the following to my packages.el file:

(package! restclient :pin "ae79e7dd283890072da69b8f48aeec1afd0d9442" )

I then ran doom sync -u and confirmed that the newer version was installed.

I also have jq-mode installed here:

  • ~/.emacs.d/./.local/straight/repos/jq-mode

However, when I attempt the use jq-set-var I get the following message:

Unknown restclient hook type jq-set-var

I have also tried running the following commands from a scratch buffer before executing a restclient query:

(require 'restclient)
(require 'jq-mode)
@shackra
Copy link

shackra commented Jun 3, 2022

yeah, I'm experiencing this as well having jq installed and using the commit ae79e7d

@shackra
Copy link

shackra commented Jun 3, 2022

Okay, after toying around with this issue, I got a workaround for Doom Emacs users:

(use-package! restclient
  :defer)
(after! restclient
  (require 'restclient-jq))

yes, we need to manually require the restclient-jq module.

And that's it, basically.

you can declare the package in your packages.el like this:

(when (package! restclient :recipe (:host github :repo "pashky/restclient.el"
                                    :files ("restclient.el" "restclient-jq.el"))
        :pin "ae79e7dd283890072da69b8f48aeec1afd0d9442")
  (package! jq-mode :recipe (:host github :repo "ljos/jq-mode")
    :pin "1af31ba701cf844f938f840ed78867c9a28174b6"))

I was unsure if Doom would pull the dependency for restclient-jq module, jq-mode, so we do that ourselves just in case.

@tompurl
Copy link
Author

tompurl commented Jun 9, 2022

This is excellent, thank you!

@micahbf
Copy link

micahbf commented Oct 17, 2022

If anyone else comes across this, doom now has this built in.

In init.el, you just need to enable the jq flag for the rest module, i.e. (rest +jq)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants