nvim-lua / kickstart.nvim

A launch point for your personal nvim configuration
MIT License
20.07k stars 24.44k forks source link

Nvim halts when declaring custom haskell data type. #788

Closed Devalyus closed 8 months ago

Devalyus commented 8 months ago

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

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

dam9000 commented 8 months ago

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.
Devalyus commented 8 months ago

Thank you very much!

dam9000 commented 8 months ago

@feoh should kickstart disable haskell treesitter highlight by default?

feoh commented 8 months ago

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 :-)