Skip to content
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

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

Open
expipiplus1 opened this issue Sep 18, 2024 · 3 comments
Open
Labels
component: ghcide status: needs info Not actionable, because there's missing information type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@expipiplus1
Copy link
Contributor

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

  • Set up astrovim and enable the haskell community pack (definitely a smaller repro)
  • Open a haskell file
  • wait for hls to init
  • type (a with a combining circumflex)
  • observe something like:
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>
@expipiplus1 expipiplus1 added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Sep 18, 2024
@michaelpj
Copy link
Collaborator

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.

@michaelpj michaelpj added the status: needs info Not actionable, because there's missing information label Oct 2, 2024
@expipiplus1
Copy link
Contributor Author

Happy to look at that, but how might I do that?

@fendor
Copy link
Collaborator

fendor commented Dec 9, 2024

Presumably, you want to interject the LSP message sent between the client and the server. I don't know how to do this in neovim, but in VSCode, you can set the option haskell.trace.server and set it to verbose.
Then the usual Output pane contains the LSP messages, and you can see exactly what is sent by the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ghcide status: needs info Not actionable, because there's missing information type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

3 participants