diff --git a/solid.errors b/solid.errors new file mode 100644 index 0000000..87f0b4f --- /dev/null +++ b/solid.errors @@ -0,0 +1,6 @@ +src/Command.hs:200:22: error: + error: [GHC-21231] + lexical error in string/character literal at character 'c' + +src/Command.hs:1:1: error: + `solid-pp' failed in phase `Haskell pre-processor'. (Exit code: 1) diff --git a/vim/sensei.test.vim b/vim/sensei.test.vim index 06f109f..84d9c70 100644 --- a/vim/sensei.test.vim +++ b/vim/sensei.test.vim @@ -163,3 +163,16 @@ call ShouldBe(err.end_col, 0) call ShouldBe(err.type, '') call ShouldBe(err.nr, -1) call ShouldBe(err.text, "") + +let errors = PopulateQuickFixList("vim/test/assets/one-line.errors") +call ShouldBe(len(errors), 1) + +let err = errors[0] +call ShouldBe(bufname(err.bufnr), "src/Editor/Vim.hs") +call ShouldBe(err.lnum, 30) +call ShouldBe(err.col, 3) +call ShouldBe(err.end_lnum, 0) +call ShouldBe(err.end_col, 0) +call ShouldBe(err.type, 'e') +call ShouldBe(err.nr, 76037) +call ShouldBe(err.text, "Not in scope: ‘cexpr’") diff --git a/vim/sensei.vim b/vim/sensei.vim index 2d843d3..9a06092 100644 --- a/vim/sensei.vim +++ b/vim/sensei.vim @@ -1,18 +1,22 @@ -setlocal makeprg=seito +set makeprg=seito " GHC -setlocal errorformat=%A%f:%l:%c:\ %t%*[^:]:\ [GHC-%n] -setlocal errorformat^=%A%f:%l:%c:\ %t%*[^:]: " GHC 9.6 +set errorformat=%A%f:%l:%c:\ %t%*[^:]:\ [GHC-%n] +set errorformat^=%A%f:%l:%c:\ %t%*[^:]: " GHC 9.6 " lines that start with a space continue the previous message -setlocal errorformat^=%+C\ %.%# +set errorformat^=%+C\ %.%# " empty lines terminate a message -setlocal errorformat^=%Z +set errorformat^=%Z " ignore this part of the message -setlocal errorformat^=%-G\ \ \ \ Suggested\ fix:%.%# -setlocal errorformat^=%-G\ \ \ \ \ \ Perhaps\ you\ meant\ %.%# " GHC 9.2 +set errorformat^=%-G\ \ \ \ Suggested\ fix:%.%# +set errorformat^=%-G\ \ \ \ \ \ Perhaps\ you\ meant\ %.%# " GHC 9.2 + +" single-line error message +set errorformat+=%f:%l:%c:\ %t%*[^:]:\ [GHC-%n]\ %m +set errorformat+=%f:%l:%c:\ %t%*[^:]:\ %m " GHC 9.6 " Hspec -setlocal errorformat^=\ \ %f:%l:%c:\ .%# +set errorformat^=\ \ %f:%l:%c:\ .%# diff --git a/vim/test/assets/one-line.errors b/vim/test/assets/one-line.errors new file mode 100644 index 0000000..729c843 --- /dev/null +++ b/vim/test/assets/one-line.errors @@ -0,0 +1 @@ +src/Editor/Vim.hs:30:3: error: [GHC-76037] Not in scope: ‘cexpr’