Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Can't recognize the variable in header #378

Open
Alienover opened this issue May 3, 2024 · 5 comments
Open

[Bug] Can't recognize the variable in header #378

Alienover opened this issue May 3, 2024 · 5 comments

Comments

@Alienover
Copy link

image

The {{TOKEN}} in this case, is parsed as value, instead of variable.

The header should be parsed to

  header
    name: name
    value: value
    value: value
    value: variable
      name: identifier
@malisoft
Copy link

malisoft commented May 8, 2024

Same problem, in my case, i tried
image
in older versions works, but i still i love this package, only is solve this little problem

@malisoft
Copy link

malisoft commented May 8, 2024

Same problem, in my case, i tried image in older versions works, but i still i love this package, only is solve this little problem

i find a solution, the problem iss because by some reason does not work when is together "Bearer {{TOKEN}}" i created another env file called ".env.http" selecting this env file using the Telescope rest env selector and storing in this env file:

TOKEN=Bearer ey.......

note that i am using a variable with a content without spaces between the texts(the problem was laravels does not support spaces un the env variables as well)

Finally this works:

GET {{APP_URL}}/api/1.0/apps?per_page=15
Authorization: {{TOKEN}}
Content-Type:application/json

@Alienover
Copy link
Author

@malisoft that's the solution I am using.... have to replace the whole Authorization value.

@NTBBloodbath
Copy link
Member

Hi, sorry for the delay. Life has been kinda busy and I'm still during exams weeks :/

I'm going to move this issue to the tree-sitter-http repository, as it seems to be a problem with the parser and not with rest.nvim itself and fix it as soon as I have some spare time to work on it.

@Alienover
Copy link
Author

rest-nvim/tree-sitter-http#29
I created this issue in tree-sitter-http before. No one replied, so I duplicated it here for visibility.

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

No branches or pull requests

3 participants