Skip to content

New release breaks everything #306

Closed

Description

@radvil

Seems like the neweset version breaks everything, all dependencies, options,everything.

Can you make a new branch associated to previous version before the breaking changes ??
It's so pain in the ass to re adjusting my configuration, like I dont have time.

Please make a new branch. Thanks

Activity

  1. radvil commented on Mar 18, 2024

    @radvil
    Author

    Also I got these errors

    [rest.nvim] WARN: Unrecognized  configs found in setup: { "keybinds.2", "keybinds.1" }
    [rest.nvim] Dependency 'lua-curl' was not found. Default HTTP client won't work
    [rest.nvim] Dependency 'xml2lua' was not found. rest.nvim will be completely unable to use XML bodies in your requests
    [rest.nvim] Dependency 'nvim-nio' was not found. rest.nvim will not work asynchronously
    [rest.nvim] Dependency 'mimetypes' was not found. rest.nvim will  be completely unable to recognize the file type of external body files
  2. 8uff3r commented on Mar 18, 2024

    @8uff3r

    I added the dependencies to luarocks.nvim and it's working, I use lazy.nvim so this is my config:

      {
        "vhyrro/luarocks.nvim",
        opts = {
          rocks = {  "lua-curl", "nvim-nio", "mimetypes", "xml2lua" }, -- Specify LuaRocks packages to install
        },
      }
  3. radvil commented on Mar 18, 2024

    @radvil
    Author

    Thanks, I ll try that. This should be clarified in the documentation.

  4. radvil commented on Mar 18, 2024

    @radvil
    Author

    I added the dependencies to luarocks.nvim and it's working, I use lazy.nvim so this is my config:

      {
        "vhyrro/luarocks.nvim",
        opts = {
          rocks = {  "lua-curl", "nvim-nio", "mimetypes", "xml2lua" }, -- Specify LuaRocks packages to install
        },
      }

    This works, but the keybinds options seems like still broken. still have that error message, but it's fine, gotta setup them manually for now

  5. NTBBloodbath commented on Mar 18, 2024

    @NTBBloodbath
    Member

    Hey, I'm very sorry that everything broke, but it was for improvement and it was necessary, nothing will break again!

    Could you send your keybind setup? I'm busy right now so I can't help much, but as soon as I can I'll take a look. Also thanks @8uff3r for helping there! :)

  6. radvil commented on Mar 18, 2024

    @radvil
    Author

    Hey, I'm very sorry that everything broke, but it was for improvement and it was necessary, nothing will break again!

    Could you send your keybind setup? I'm busy right now so I can't help much, but as soon as I can I'll take a look. Also thanks @8uff3r for helping there! :)

    It's okay for breaking changes, I like a new result preview, however it is better to make a stable release for the previous version that doesn't break, because I needed to search to the whole commit history just to make everything works as the previous one again.

    Anyway, here is my config options:

        opts = {
          client = "curl",
          env_file = ".env",
          env_pattern = "\\.env$",
          env_edit_command = "tabedit",
          encode_url = true,
          skip_ssl_verification = false,
          custom_dynamic_variables = {},
          logs = {
            level = "info",
            save = true,
          },
          highlight = {
            enable = true,
            timeout = 750,
          },
          result = {
            split = {
              in_place = false,
              horizontal = false,
              stay_in_current_window_after_split = true,
            },
            behavior = {
              decode_url = true,
              show_info = {
                url = true,
                headers = true,
                http_info = true,
                curl_command = true,
              },
              formatters = {
                json = "jq",
                html = function(body)
                  if vim.fn.executable("tidy") == 0 then
                    return body, { found = false, name = "tidy" }
                  end
                  local fmt_body = vim.fn.system({
                    "tidy",
                    "-i",
                    "-q",
                    "--tidy-mark", "no",
                    "--show-body-only", "auto",
                    "--show-errors", "0",
                    "--show-warnings", "0",
                    "-",
                  }, body):gsub("\n$", "")
    
                  return fmt_body, { found = true, name = "tidy" }
                end,
              },
            },
          },
          keybinds = {
            { "<localleader>rr", "<cmd>Rest run<cr>",      "Run request under the cursor", },
            { "<localleader>rl", "<cmd>Rest run last<cr>", "Re-run latest request", },
          }
        },

    I just pasted everything from the default config based on the new README.

  7. radvil commented on Mar 18, 2024

    @radvil
    Author

    I leave this comment here, just in case anyone else that want to revert to previous version.
    This is latest commit that works 91badd46c60df6bd9800c809056af2d80d33da4c

  8. 8uff3r commented on Mar 18, 2024

    @8uff3r

    Hey, I'm very sorry that everything broke, but it was for improvement and it was necessary, nothing will break again!

    Could you send your keybind setup? I'm busy right now so I can't help much, but as soon as I can I'll take a look. Also thanks @8uff3r for helping there! :)

    It's okay for breaking changes, I like a new result preview, however it is better to make a stable release for the previous version that doesn't break, because I needed to search to the whole commit history just to make everything works as the previous one again.

    Anyway, here is my config options:

        opts = {
          client = "curl",
          env_file = ".env",
          env_pattern = "\\.env$",
          env_edit_command = "tabedit",
          encode_url = true,
          skip_ssl_verification = false,
          custom_dynamic_variables = {},
          logs = {
            level = "info",
            save = true,
          },
          highlight = {
            enable = true,
            timeout = 750,
          },
          result = {
            split = {
              in_place = false,
              horizontal = false,
              stay_in_current_window_after_split = true,
            },
            behavior = {
              decode_url = true,
              show_info = {
                url = true,
                headers = true,
                http_info = true,
                curl_command = true,
              },
              formatters = {
                json = "jq",
                html = function(body)
                  if vim.fn.executable("tidy") == 0 then
                    return body, { found = false, name = "tidy" }
                  end
                  local fmt_body = vim.fn.system({
                    "tidy",
                    "-i",
                    "-q",
                    "--tidy-mark", "no",
                    "--show-body-only", "auto",
                    "--show-errors", "0",
                    "--show-warnings", "0",
                    "-",
                  }, body):gsub("\n$", "")
    
                  return fmt_body, { found = true, name = "tidy" }
                end,
              },
            },
          },
          keybinds = {
            { "<localleader>rr", "<cmd>Rest run<cr>",      "Run request under the cursor", },
            { "<localleader>rl", "<cmd>Rest run last<cr>", "Re-run latest request", },
          }
        },

    I just pasted everything from the default config based on the new README.

    You can use lazy.nvim to setup your keybinds with keys:

      {
        "rest-nvim/rest.nvim",
        keys = {
          { "<leader>rr", "<cmd>Rest run<cr>", desc = "Run REST request" },
        },
      },
  9. NTBBloodbath commented on Mar 18, 2024

    @NTBBloodbath
    Member

    however it is better to make a stable release for the previous version that doesn't break, because I needed to search to the whole commit history just to make everything works as the previous one again.

    In the repository there are tags and semantic releases that you can use in your plugin manager to rollback to the previous stable release :)


    Now, that bug is a little weird, I'll definitely take a look at it as soon as I get home, thanks for reporting it and also for providing a commit in case someone wants to rollback that way, that is appreciated.

  10. radvil commented on Mar 18, 2024

    @radvil
    Author

    however it is better to make a stable release for the previous version that doesn't break, because I needed to search to the whole commit history just to make everything works as the previous one again.

    In the repository there are tags and semantic releases that you can use in your plugin manager to rollback to the previous stable release :)

    Now, that bug is a little weird, I'll definitely take a look at it as soon as I get home, thanks for reporting it and also for providing a commit in case someone wants to rollback that way, that is appreciated.

    Oh, my bad, I didn't check the release tags, haha. Sorry for that

  11. NTBBloodbath commented on Mar 18, 2024

    @NTBBloodbath
    Member

    @radvil I think I fixed the keybinds configuration table issue, could you please update and check if the issue persists in your end?

  12. 29 remaining items

  13. bowmanpete123 commented on Mar 23, 2024

    @bowmanpete123

    Heres what pops up for me:

    image

    I'm not sure what the go is sadly :/

  14. bowmanpete123 commented on Mar 23, 2024

    @bowmanpete123

    Tried to install luarocks on its own and then rest and still same error popping up :/

  15. NTBBloodbath commented on Mar 23, 2024

    @NTBBloodbath
    Member

    Hey @mesa123123, just noticed I had to modify the build.lua script to adopt some breaking changes in the luarocks.nvim plugin, could you please try again? Let's hope this one does the trick and my apologies for the inconveniences :)

  16. bowmanpete123 commented on Mar 23, 2024

    @bowmanpete123

    No dice sorry :/

    image

    Maybe its my config?

  17. bowmanpete123 commented on Mar 23, 2024

    @bowmanpete123

    Also no need to apologise! This is part of being in open source! All part of it :D

  18. bowmanpete123 commented on Mar 25, 2024

    @bowmanpete123

    OK so I think I got it working:

    Basically I've added paths to my package path so nvim knows where to look for my paths:

    -- Package Path Upgrade
    ----------
    -- Rocks installed through luarocks.nvim
    package.path = package.path .. ";" .. plugin_path .. "/luarocks.nvim/.rocks/share/lua/6.1/?.lua;"
    package.path = package.path .. ";" .. plugin_path .. "/luarocks.nvim/.rocks/share/lua/5.1/?/?.lua;"
    -- Rocks installed through local luarocks
    package.path = package.path .. ";" .. fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua;"
    package.path = package.path .. ";" .. fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua;"
    ----------

    And it seems to work now! Or at least my errors are all about treesitter!

    19:49:02 msg_show   e http.http Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:24: Error executing lua: /usr/share/nvim/runtime/filetype.lua:25: BufNewFile Autocommands for "*"..FileType Autocommands for "http"..FileType Autocommands for "*": Vim(append):Error executing lua callback: /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 229 for language http
    stack traceback:
    	[C]: in function '_ts_parse_query'
    	/usr/share/nvim/runtime/lua/vim/treesitter/query.lua:259: in function 'get'
    	/usr/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:114: in function 'new'
    	/usr/share/nvim/runtime/lua/vim/treesitter.lua:61: in function '_create_parser'
    	/usr/share/nvim/runtime/lua/vim/treesitter.lua:131: in function 'get_parser'
    	/usr/share/nvim/runtime/lua/vim/treesitter.lua:460: in function 'start'
    	...m/lazy/nvim-treesitter/lua/nvim-treesitter/highlight.lua:20: in function 'attach'
    	...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:509: in function 'attach_module'
    	...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:532: in function 'reattach_module'
    	...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:133: in function <...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:132>
    	[C]: in function 'nvim_exec_autocmds'
    	...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:157: in function <...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:156>
    	[C]: in function 'xpcall'
    	.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:113: in function 'try'
    	...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:156: in function 'trigger'
    	...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:87: in function <...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:72>
    	[C]: in function 'nvim_cmd'
    	/usr/share/nvim/runtime/filetype.lua:25: in function </usr/share/nvim/runtime/filetype.lua:24>
    	[C]: in function 'nvim_buf_call'
    	/usr/share/nvim/runtime/filetype.lua:24: in function </usr/share/nvim/runtime/filetype.lua:10>
    stack traceback:
    	[C]: in function 'nvim_cmd'
    	/usr/share/nvim/runtime/filetype.lua:25: in function </usr/share/nvim/runtime/filetype.lua:24>
    	[C]: in function 'nvim_buf_call'
    	/usr/share/nvim/runtime/filetype.lua:24: in function </usr/share/nvim/runtime/filetype.lua:10>
    stack traceback:
    	[C]: in function 'nvim_buf_call'
    	/usr/share/nvim/runtime/filetype.lua:24: in function </usr/share/nvim/runtime/filetype.lua:10>
    

    Thats the output I get when I open a .http file

  19. kevinm6 commented on Mar 26, 2024

    @kevinm6
    Contributor

    I arrive a little later, but I figure out a way to make it works on macOS using previous comments and advice.
    (the config is based on Lazy.nvim)

      {
        "vhyrro/luarocks.nvim”,
        -- explicit tell Lazy the module name due to error on calling
        --  the module with the suffix ‘.nvim’; in this way Lazy will call < require “luarocks”.setup({}) >
        name = "luarocks”,
        config = true
      },
      {
        "rest-nvim/rest.nvim",
        dependencies = { "luarocks" },
        ft = { "http", "https" },
        config = function(_, o)
          require "rest-nvim".setup(o)
        end
      }

    With this config all the build and installation is done correctly.

  20. caenrique commented on Mar 27, 2024

    @caenrique

    with all the breaking changes, it would be nice to have documentation on how to migrate from the previous setup

  21. nezudevv commented on Apr 2, 2024

    @nezudevv

    I seem to be getting an error as well. Not sure if it's related to this new release but sharing just in case. I am also stuck trying to get past it.

    Here is the error message. It seems to be a tree-sitter parsing issue but cannot for the life of me get passed this.
    Happens when running :Rest run while hilghighting the request line in a HTTP file.

    [rest.nvim] ERROR: The tree-sitter node at the range [0:0 - 25] has a syntax error and cannot be parsed
    Error executing Lua callback: .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:114: attempt to index local 'req_node' (a nil value)
    stack traceback:
            .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:114: in function 'traverse_request'
            .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:432: in function 'parse'
            ...al/share/nvim/lazy/rest.nvim/lua/rest-nvim/functions.lua:61: in function 'exec'
            ...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:44: in function 'impl'
            ...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:182: in function <...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:165>
    
    My nvim setup: 
    
     {
        "vhyrro/luarocks.nvim",
        branch = "go-away-python",
        lazy = false,
      },
      {
        "rest-nvim/rest.nvim",
        ft = "http",
        dependencies = { "luarocks.nvim" },
        config = function()
          require("rest-nvim").setup()
        end,
      },
    
    And treesitter: 
     {
        "nvim-treesitter/nvim-treesitter",
        ensure_installed = { "lua", "xml", "http", "json", "graphql" },
        opts = overrides.treesitter,
      },
    

    I should say that I've also tried several other iterations of configs setup that have been suggested in this thread, all with the same result.

  22. cyaconi commented on Apr 2, 2024

    @cyaconi

    I seem to be getting an error as well. Not sure if it's related to this new release but sharing just in case. I am also stuck trying to get past it.

    Here is the error message. It seems to be a tree-sitter parsing issue but cannot for the life of me get passed this. Happens when running :Rest run while hilghighting the request line in a HTTP file.

    [rest.nvim] ERROR: The tree-sitter node at the range [0:0 - 25] has a syntax error and cannot be parsed
    Error executing Lua callback: .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:114: attempt to index local 'req_node' (a nil value)
    stack traceback:
            .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:114: in function 'traverse_request'
            .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:432: in function 'parse'
            ...al/share/nvim/lazy/rest.nvim/lua/rest-nvim/functions.lua:61: in function 'exec'
            ...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:44: in function 'impl'
            ...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:182: in function <...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:165>
    
    My nvim setup: 
    
     {
        "vhyrro/luarocks.nvim",
        branch = "go-away-python",
        lazy = false,
      },
      {
        "rest-nvim/rest.nvim",
        ft = "http",
        dependencies = { "luarocks.nvim" },
        config = function()
          require("rest-nvim").setup()
        end,
      },
    
    And treesitter: 
     {
        "nvim-treesitter/nvim-treesitter",
        ensure_installed = { "lua", "xml", "http", "json", "graphql" },
        opts = overrides.treesitter,
      },
    

    I should say that I've also tried several other iterations of configs setup that have been suggested in this thread, all with the same result.

    Check trailing spaces in your http file, delete them even in --{% and --%} lines if you're using script variables. I struggled with the same issue until I realized that removing trailing spaces solves many of the treesitter's errors. Same with JSONs, make sure they are well formatted too.

  23. nezudevv commented on Apr 3, 2024

    @nezudevv

    I seem to be getting an error as well. Not sure if it's related to this new release but sharing just in case. I am also stuck trying to get past it.
    Here is the error message. It seems to be a tree-sitter parsing issue but cannot for the life of me get passed this. Happens when running :Rest run while hilghighting the request line in a HTTP file.

    [rest.nvim] ERROR: The tree-sitter node at the range [0:0 - 25] has a syntax error and cannot be parsed
    Error executing Lua callback: .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:114: attempt to index local 'req_node' (a nil value)
    stack traceback:
            .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:114: in function 'traverse_request'
            .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:432: in function 'parse'
            ...al/share/nvim/lazy/rest.nvim/lua/rest-nvim/functions.lua:61: in function 'exec'
            ...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:44: in function 'impl'
            ...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:182: in function <...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:165>
    
    My nvim setup: 
    
     {
        "vhyrro/luarocks.nvim",
        branch = "go-away-python",
        lazy = false,
      },
      {
        "rest-nvim/rest.nvim",
        ft = "http",
        dependencies = { "luarocks.nvim" },
        config = function()
          require("rest-nvim").setup()
        end,
      },
    
    And treesitter: 
     {
        "nvim-treesitter/nvim-treesitter",
        ensure_installed = { "lua", "xml", "http", "json", "graphql" },
        opts = overrides.treesitter,
      },
    

    I should say that I've also tried several other iterations of configs setup that have been suggested in this thread, all with the same result.

    Check trailing spaces in your http file, delete them even in --{% and --%} lines if you're using script variables. I struggled with the same issue until I realized that removing trailing spaces solves many of the treesitter's errors. Same with JSONs, make sure they are well formatted too.

    @cyaconi I have made sure that all of the white space has been cleared, there were none so unfortunately that isn't the issue :/

  24. kevinm6 commented on Apr 3, 2024

    @kevinm6
    Contributor

    @nezudevv try to change luarocks.nvim to

    {
        "vhyrro/luarocks.nvim”,
        name = ‘luarocks’,
        opts = {
          rocks = { "lua-curl", "nvim-nio", "mimetypes", "xml2lua" }
        }
    }

    Before reloading this config, in the Lazy dashboard go over luarocks.nvim and rest.nvim and press x to remove the plugins and clean their directories.
    After that close and reopen Neovim !

    If this is not working, try to send here the content of the file you’re trying to run via rest.nvim

  25. locked and limited conversation to collaborators on Apr 4, 2024
  26. converted this issue into a discussion #348 on Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersv2rest.nvim v2 issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions