Closed skela closed 8 months ago
Hi, exactly which character of the method do you have the cursor on? I'm currently in college so I won't be able to help much right now
Quick question: does your local installation have this commit? I don't seem to be able to reproduce it 🙁
I typically have the cursor on the first character of the line that has the method + url in it, so in this case it would be on the P character. But ive tested it all along that 1st line, its complaining about the same thing regardless of where i have the cursor on that line.
yes the local checkout has that commit in it:
Been thinking, it could possibly be a telescope version issue? I havent pinned my telescope, what checkout of telescope are u running?
That's weird as I'm unable to reproduce the error. Could you send your :InspectTree
output in the http file? Just to rule out that there's no problem with the parser
Oh, there is a syntax error in the Lua scripting code, I think that could be the cause. Use --{%
and --%}
as the delimiters instead of {%
and %}
to fix the scripting to the new syntax (that change was necessary to avoid false errors with tree-sitter injected languages)
Ah ok, i did notice that in yer docs, but i tried with and without that and it didnt seem to make a difference. If I change it to the way you described, it still fails, but with a different error. :InspectTree looks good though.
Seems like its complaining about my env variables, it might not be able to load them anymore. Used to in the previous versions.
For reference, i have all the http files + the env in a folder called api.
api/login.http api/environments/prod.http.env
Have tried to run it with my cwd 1 level above the api folder (which is my git root), but i get the same error if i cd into the api folder and try to run it from there.
Figured it out. It seems rest.nvim is a bit more sensitive to json formatting in the payloads than it used to be. The trailing comma after the password value, caused something to fail somewhere. This used to work, but i suppose it never should have worked (because trailing comma in json isnt really valid).
All good, it works, thanks for your help (and yer very awesome plugin)!
Oh woops, it seems like my vision might be failing since I hadn't noticed that trailing comma hah. And yeah, now rest.nvim
is more strict about that since the JSON body is handled directly by the tree-sitter JSON parser, which we use to obviously parse it :p
Before, if I'm not mistaken, we also used Vimscript functions for JSON, now we use vim.json
which is a JSON parser made in C and embedded in Neovim so that could also have affected the trailing commas being valid before.
Thank you very much for your time, a pleasure to have helped :)
Updated to the latest version today, but seem to be unable to get it working, even after updating my config.
This is what I have for my login.http file:
After selecting my environment, I move the cursor to the POST API line, then run :Rest run , and it fails with some telescope errors.