qvalentin / helm-ls.nvim

neovim lua plugin for helm-ls
MIT License
3 stars 1 forks source link

bug: error on cursor move when helm-ls enabled #4

Closed eshepelyuk closed 3 hours ago

eshepelyuk commented 4 hours ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.10.2 Build type: Release LuaJIT 2.1.1727870382

Operating system/version

Linux 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux Using vim-plug as plugin manager.

Describe the bug

After opening a file - I see this error when moving a cursor or clicking with mouse image

Steps To Reproduce

  1. Install plugin with default config
    
    local lspconfig = require('lspconfig')
    lspconfig.helm_ls.setup({})
    require("helm-ls").setup({})

2. Open helm template, i.e. file from `tempaltes/` fodler of a chart.
3. Move cursor or click with mouse in the middle of the file.

### Expected Behavior

No errors shown.
qvalentin commented 3 hours ago

Fixed, keep in mind that you still need the helm tree-sitter grammar for now (https://github.com/nvim-treesitter/nvim-treesitter). Otherwise you will get errors again. I will try to make this more userfriendly later this weekend.

eshepelyuk commented 2 hours ago

Sorry, but I think the fix should be to to remove all code from plugin/helm-ls.lua file. Autocommand should be created only by calling setup() function, When plugin enabled without invoking setup() - it only adds filetype detection. This also help to remove code duplication in plugin/helm-ls.lua and setup().

Currently, I am receiving following error, even if i had this in my init.lua

require("helm-ls").setup({
    conceal_templates = {
      -- enable the replacement of templates with virtual text of their current values
      enabled = false, -- this might change to false in the future
    },
    indent_hints = {
      -- enable hints for indent and nindent functions
      enabled = false,
      -- show the hints only for the line the cursor is on
      only_for_current_line = true,
    },
})

image

To avoid this - I cloned the plugin and commented all code in plugin/helm-ls.lua

qvalentin commented 2 hours ago

Feel free to open a PR for this.

eshepelyuk commented 2 hours ago

NP opening a PR, but plz suggest what should I put there ? Is emptying plugin/helm-ls.lua enough ?

qvalentin commented 2 hours ago

Sorry if im a bit uncooperative. I think i will just get back to you when I'm back on a PC and not on mobile. But thanks for the feedback <3

eshepelyuk commented 2 hours ago

Sorry if im a bit uncooperative. I think i will just get back to you when I'm back on a PC and not on mobile. But thanks for the feedback <3

Opened this https://github.com/qvalentin/helm-ls.nvim/pull/5