kickstart.nvim icon indicating copy to clipboard operation
kickstart.nvim copied to clipboard

Nvim halts when declaring custom haskell data type.

Open Devalyus opened this issue 2 years ago • 1 comments

Describe the bug

When I try to write haskell custom data type (the snippet below). Neovim keeps halting right after writing Ship. And one cpu core starts spinning under 100% load. I have attached video below.

data Thing = Shoe
           | Ship
           | SealingWax
           | Cabbage
           | King
  deriving Show

To Reproduce

  1. Open new file with extension .hs
  2. Start typing the haskell snippet above.
  3. Neovim should halt after writing Ship.

Desktop

  • OS: Fedora 39
  • Terminal: gnome-terminal
  • I have only one plugin installed which is https://github.com/alexghergh/nvim-tmux-navigation
  • With Mason, I have lua-language-server and stylua

Neovim Version

NVIM v0.9.5
Build type: RelWithDebInfo
LuaJIT 2.1.1707061634
Compilation: /usr/bin/gcc -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -
Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=auto -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DUSING_UV_SHARED=1 -I/us
r/include/luajit-2.1 -I/usr/include -I/usr/include/luv -I/builddir/build/BUILD/neovim-0.9.5/redhat-linux-build/src/nvim/auto -I/builddir/build/BUILD/neovim-0.9.5/redhat-linux-build/include -I/builddir/build/BUIL
D/neovim-0.9.5/redhat-linux-build/cmake.config -I/builddir/build/BUILD/neovim-0.9.5/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Screencast from 2024-03-23 15-56-01.webm

Devalyus avatar Mar 23 '24 16:03 Devalyus

I can reproduce this and it seems to be caused by the Treesitter highlighting. I would recommend that you open an issue with the nvim-treesitter project: https://github.com/nvim-treesitter/nvim-treesitter

You can work-around that by disabling it for haskell with this change:

diff --git a/init.lua b/init.lua
index 013fcc2..db5a0c7 100644
--- a/init.lua
+++ b/init.lua
@@ -796,6 +796,7 @@ require('lazy').setup({
       auto_install = true,
       highlight = {
         enable = true,
+        disable = { 'haskell' },
         -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
         --  If you are experiencing weird indenting issues, add the language to
         --  the list of additional_vim_regex_highlighting and disabled languages for indent.

dam9000 avatar Mar 23 '24 17:03 dam9000

Thank you very much!

Devalyus avatar Mar 24 '24 03:03 Devalyus

@feoh should kickstart disable haskell treesitter highlight by default?

dam9000 avatar Mar 24 '24 08:03 dam9000

it's an excellent question but I must admit I don't know anything at all about that space.

Is this a relatively transient failure or will be broken for all time? I certainly don't know :-)

feoh avatar Mar 24 '24 13:03 feoh