kylebebak / Requester

Powerful, modern HTTP/REST client built on top of the Requests library
https://kylebebak.github.io/Requester/
MIT License
307 stars 10 forks source link

FR: allow requester to work inside Docblocks #16

Closed adrienne closed 6 years ago

adrienne commented 6 years ago

I just found this plugin and i am in love already. I have one request: I use docblocks a lot, and it would be super handy if i could just embed a Requester line directly into the description field and hit Ctrl+Alt+R to have it parse (currently it won't; it throws an error because of the leading *). Here's the kind of thing i envision:

/**
 * Testing
 * 
 * Blah blah long description
 * API output:
 * requests.get('https://someURL.com/api/v1/departments')
 * 
 * @otherstuff
 * 
 */
kylebebak commented 6 years ago

Thanks for opening this issue. I've been thinking about it for a few days and thought it would be hard to implement changes to the parser to correctly parse a request like the one in your example, but it's not.

I'll push a new release with this change soon.

kylebebak commented 6 years ago

@adrienne

Pretty sure this is fixed now! Try placing your cursor anywhere on the line with the call to requests.get and run Requester.

Closing this issue, let me know if you're having any other trouble.

adrienne commented 6 years ago

@kylebebak - Nope, still getting an error. (I did make sure i upgraded the SublimeText plugin first, obviously.)

image

kylebebak commented 6 years ago

Hmm, I can't repro the issue on my machine (I'm running Requester v2.28.0).

Could you paste the text, including the surrounding lines, and show me where you're putting your cursor when you run Requester?

adrienne commented 6 years ago

@kylebebak - Here's the text:

/**
 * Testing
 * 
 * Blah blah long description
 * API output:
 * requests.get('https://api-domain.test/v1/blah', verify=False)
 * 
 * @otherstuff
 * 
 */

And it doesn't matter where i put my cursor; i tried at the beginning of the line as well as in the middle.

kylebebak commented 6 years ago

Weird!

When I try to execute this request, the error I get is different. Requester parses the request correctly, but there is a connection error because the site doesn't exist.

Check out the error printed to the console at the bottom of the page, and check where my cursor is in the request. I can put my cursor anywhere on that line and it works...

Are you sure you're running Requester v2.28.0? I'm going to try removing my dev copy, installing Requester from Package Control, and seeing what happens.

screen shot 2018-11-02 at 9 00 38 am
kylebebak commented 6 years ago

So I removed my dev copy of Requester and installed it from Package Control, and I still can't reproduce the bug.

I'm running Requester 2.28.0 and it parses your request just fine. Could you try uninstalling Requester and installing it again?

Or, could you run Package Control: List Packages and check that your Requester is at the same version as mine?

screen shot 2018-11-02 at 10 01 51 am
adrienne commented 6 years ago

@kylebebak Doesn't look like it is the same version? I uninstalled and reinstalled, but this is what i get: image

But anyway, i uninstalled and reinstalled, and while I still don't get the same version as your screencap above, it works now. So you can close this!

kylebebak commented 6 years ago

Right on!

We're running the same version now, mine is just displayed differently (with a timestamp instead of the version tag).

I'm glad this works now!