-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
v3 migration issue #414
Comments
Old method is still supported (which just assigns given argument to require(“rest-nvim”).setup({
-- your config
})
vim.g.rest_nvim = {
-- your config
} These two are basically identical. I’ve considered making some deprecated options but decided to just drop the breaking change as this plugin has been archived for a while and people from v2 version will get breaking changes anyways. If I manually convert your config to v3 spec, it would be like this: {
"rest-nvim/rest.nvim",
dependencies = { "luarocks.nvim" },
config = function()
require("rest-nvim").setup({
env = {
pattern = "%.env$"
},
ui = {
keybinds = {
prev = "P",
next = "N",
},
},
})
vim.keymap.set("n", "<leader>rr", "<cmd>Rest run<CR>", { desc = "Run rest command" })
vim.keymap.set("n", "<leader>rl", "<cmd>Rest run last<CR>", { desc = "Run last rest command" })
end,
} Several notes:
|
Thank you @boltlessengineer , that helps a lot, i've gotten the plugin working again. However it seems some features I really enjoyed were removed.
Those features made this plugin work great with my workflow and really enjoyed it :) , if more appropriate I can open feature request (or multiple not sure what is preffered). Thanks! |
Those features are not removed but implemented as a different form now. Controlling result pane opening modeNow all window-opening rest.nvim user commands support command-modifiers ( For example, you can open result pane with If formatting doesn’t workrest.nvim now uses Neovim’s builtin formatting feature to format the buffer. ( LSP and conform.nvim provides If you use conform.nvim for formatting (recommended)set vim.bo.formatexpr = “v:lua.require’conform’.formatexpr()” If you use LSP or none-ls for formattingset vim.bo.formatexpr = “v:vim.lsp.formatexpr()” Note If you use none-ls, you may need to adjust some more settings. |
pinning this issue as more people might have similar problems. |
Thank you, the info on the modifiers helped, got me back to my workflow that I had before, and would be great to have command-modifiers on Now I'm still struggling with formatting. I am indeed using an LSP, I checked if
I have the print statement to confirm that when I get the results in the debug window that it's detecting JSON. I get the message, however I don't get formatting. I did confirm that i now see I saw in #417 you mentioned opening a JSON file and trying |
What formatter are you using? Do you have a formatter plugin or language server that should attached to any json buffer? If you set vim.api.nvim_create_autocmd("FileType", {
pattern = "json",
callback = function(ev)
vim.bo[ev.buf].formatprg = “jq”
print("It's a json file")
end,
}) |
|
What language server do you expect to format the json file? |
Expected language server is
|
Can confirm not working. Seems like it takes time for language server to be attached to a scratch buffer. I would recommend you to use setlocal formatexpr=
setlocal formatprg=jq or in lua: vim.bo.formatexpr = ""
vim.bo.formatprg = "jq" You can put this setting in |
Environment variable is broken for me, it makes request to gibberish URL |
@mrlectus please create a new issue with reproduce steps |
Thank you! I spent a while toiling with no json formatting in my responses and this (ftplugin/json.lua file created) did the trick. |
I can confirm it works but not with these quotation marks, it worked for me when I used vim.bo.formatexpr = ""
vim.bo.formatprg = "jq" |
@pdarulewski didn't noticed I used wrong quotes. I just edited my comment. Thank you for noticing me! |
My configuration for rest-nvim has been unchanged for months but after updating to the latest version it breaks my configuration and I get the following error.
Configuration is below, looking at the readme it seems the way to configure rest-nvim may have changed, although I'm not sure how to convert what I have to the new method as it doesn't seem to have the same options. I'm also not familiar with using vim.g to configure a module. Is the old method of configuration no longer supported?
The text was updated successfully, but these errors were encountered: