haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.72k stars 368 forks source link

completion snippets behave badly in the presence of combining diacritics #4404

Open expipiplus1 opened 2 months ago

expipiplus1 commented 2 months ago

Your environment

Which LSP client (editor/plugin) do you use? Neovim, astrovim (which I think is using luasnips and nvim-cmp)

The actual crash is in nvim-cmp, so it's quite possibly a bug there, but at least turning off plugin.ghcide-completions.config.snippetsOn seems to fix things, so opening this issue just in case anyone else searches combining diacritics snippets or something.

Sorry for the low quality report!

Which version of HLS do you use and how did you install it? haskell-language-server version: 2.9.0.0 (GHC: 9.8.2)

Steps to reproduce

Error executing vim.schedule lua callback: ...l/share/astrovim/lazy/nvim-cmp/lua/cmp/utils/snippet.lua:409: snippet parsing failed.
stack traceback:
        [C]: in function 'error'
        ...l/share/astrovim/lazy/nvim-cmp/lua/cmp/utils/snippet.lua:409: in function 'parse'
        .../e/.local/share/astrovim/lazy/nvim-cmp/lua/cmp/entry.lua:130: in function 'callback'
        ...cal/share/astrovim/lazy/nvim-cmp/lua/cmp/utils/cache.lua:38: in function 'get_word'
        .../e/.local/share/astrovim/lazy/nvim-cmp/lua/cmp/entry.lua:81: in function 'callback'
        ...cal/share/astrovim/lazy/nvim-cmp/lua/cmp/utils/cache.lua:38: in function 'get_offset'
        ...e/.local/share/astrovim/lazy/nvim-cmp/lua/cmp/source.lua:353: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
michaelpj commented 1 month ago

Certainly there's a client bug there, but if you can check the snippet that gets sent to the client and see if it has anything wrong with it, that would be helpful.