tanhakabir / rest-book

REST Book is a Visual Studio Code extension that allows you to perform REST calls in a Notebook interface.
https://marketplace.visualstudio.com/items?itemName=tanhakabir.rest-book
MIT License
248 stars 24 forks source link

bugfix/variable tokens eval #134

Open pbrouillet opened 2 years ago

pbrouillet commented 2 years ago

To improve variable evaluations, this change adds support for curly brackets evaluation. It can be used several times inside the URL, headers or body of a request since it is parsed through regex groups. Also, an initial Hover over variables will display the variable content if it was already processed.

Some of the caching and variable extraction was moved from the request.ts into a new dedicated class. Since the Hover doesn't have context of the request nor the Notebook cell (only the code document of the cell being hovered), the variable parser is a singleton and so lives through executed requests and the session of the file. This part can probably be improved.

pbrouillet commented 2 years ago

@tanhakabir Hello! Can you review this PR, please :)?