jellydn / hurl.nvim

Hurl.nvim is a Neovim plugin designed to run HTTP requests directly from `.hurl` files. Elevate your API development workflow by executing and viewing responses without leaving your editor.
https://gyazo.com/19492e8b5366cec3f22d5fd97a63f37a
MIT License
156 stars 16 forks source link

Collides with mapping and filetypes #197

Closed JPFrancoia closed 3 weeks ago

JPFrancoia commented 3 weeks ago

Hi, This plugin works well, except that it somehow collides with other stuff. Just setting it up with the below makes me lose some other functionalities of neovim:

require('hurl').setup({})

For example, I have this mapping to accept a suggestion from Copilot, and it simply doesn't work anymore (pressing the right arrow doesn't accept the suggestion like it's supposed to):

imap <silent><script><expr> <Right> copilot#Accept("\<CR>")

Also, somehow the file detection for go and sql files (and potentially other, I haven't tried) seems to be gone.

The only things I added to make this plugin work were:

require'nvim-treesitter.configs'.setup {
    ensure_installed = {"python", "rust", "sql", "terraform", "go", "yaml", "dart", "hurl"},
    auto_install = true,
    highlight = {
        enable = true,
    },
}

I added the "hurl" bit to the ensure installed line

I installed these two plugins (I already had plenary):

Plug 'jellydn/hurl.nvim', {'branch': 'main'}
Plug 'MunifTanjim/nui.nvim', {'branch': 'main'}

Any thoughts?

EDIT:

This line is causing all the troubles: https://github.com/jellydn/hurl.nvim/blob/87ff7860aa5655d87056b6b63fecb1ecd4d0b587/lua/hurl/utils.lua#L201. If I comment it, hurl.nvim works and I get back all the lost functionalities.

jellydn commented 3 weeks ago

Hi @JPFrancoia Could you run checkheath hurl and share the output?

hurl: require("hurl.health").check()

hurl.nvim health check ~
- OK jq found
- OK prettier found
- OK treesitter[hurl]: installed
- OK hurl.nvim: All good!
JPFrancoia commented 3 weeks ago

Here you are:

hurl: require("hurl.health").check()

hurl.nvim health check ~
- OK jq found
- ERROR prettier not found
- WARNING treesitter[hurl]: missing parser for syntax highlighting. Install "nvim-treesitter/nvim-treesitter" plugin and run ":TSInstall hurl".
- OK hurl.nvim: All good!

I did uninstall the hurl parser for treesitter when I was trying to solve the problem. Having it or not having doesn't change anything from what I could see.

jellydn commented 3 weeks ago

Ok, I see. It should work if you run :TSInstall hurl. Let me know if any issues. Thanks.

JPFrancoia commented 3 weeks ago

I think treesitter is the problem, even after (re)installing the hurl parser the health check still prints the warning:

screen-2024-09-22-16-38-01