rest.nvim
rest.nvim copied to clipboard
File variable support
VSC**es's REST client plugin, which is similar to rest.nvim, supports file variables. Here's an example to illustrate:
@baseUrl = https://test.url.com
@access_token = beepboopaccesstoken
###
DELETE {{baseUrl}}/posts/50
Authorization {{access_token}}
The team I work with all use VSC**e and so in the project root there's a .vscode/requests.http
file with various requests to the services we're building, which is also checked into git. I was hoping to be able to use rest.nvim with this file, but it is filled with file variables like in the example above. I think file variable support would be really cool.
is that some kind of standard or just this vscode extension's format ?
@teto As far as I can tell this is only the extension's custom format. However, the extension does have 2.6 million installs so it is quite an established format in that sense. It's also a relatively simple format, syntax-wise.
this would be so nice to have!
apparently fixed buy #152 feel free to reopen if not the case
That's great! Thank you very much @theNEOkun!
It would be great now if the Treesitter parser for HTTP supported this syntax. I noticed that it lives under the same GitHub organization, and I've created an issue here: rest-nvim/tree-sitter-http/issues/6.
@NTBBloodbath Was this functionality removed in the new release?
@NTBBloodbath Was this functionality removed in the new release?
Hi, nope. It still exists, only now if the variable contains text it must be enclosed in a string (@foo = "https://..."
) :)
@NTBBloodbath I see, thank you!