Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sol committed Oct 24, 2024
1 parent 6149f94 commit 8b7a6fd
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
6 changes: 6 additions & 0 deletions solid.errors
Original file line number Diff line number Diff line change
@@ -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)
13 changes: 13 additions & 0 deletions vim/sensei.test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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’")
20 changes: 12 additions & 8 deletions vim/sensei.vim
Original file line number Diff line number Diff line change
@@ -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:\ .%#
1 change: 1 addition & 0 deletions vim/test/assets/one-line.errors

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8b7a6fd

Please sign in to comment.