Nvim halts when declaring custom haskell data type.
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
- Open new file with extension .hs
- Start typing the haskell snippet above.
- 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"
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.
Thank you very much!
@feoh should kickstart disable haskell treesitter highlight by default?
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 :-)