Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for errorformat #275

Open
kdheepak opened this issue Sep 7, 2021 · 0 comments
Open

Support for errorformat #275

kdheepak opened this issue Sep 7, 2021 · 0 comments

Comments

@kdheepak
Copy link

kdheepak commented Sep 7, 2021

Vim has support for writing compiler plugins: https://vimhelp.org/usr_41.txt.html#write-compiler-plugin

It would be nice to run tests and get the stacktrace populated in the quickfix list. I imagine this is not straightforward but setting the right errorformat is probably a good place to start. This is what a sample stacktrace looks like:

KeyError: key foobar not found
   [1] getindex
     @ ./dict.jl:481 [inlined]
   [2] function_name!()
     @ ModuleName /path/to/folder/PackageName/src/filename.jl:17

I imagine a file placed in ./runtime/compiler/julia.vim might be able to parse this line: @ ModuleName /path/to/folder/PackageName/src/filename.jl:17:

" Vim compiler file
" julia-vim/runtime/compiler/julia.vim

let s:cpo_save = &cpo
set cpo&vim

if exists(":CompilerSet") != 2
	command -nargs=* CompilerSet setlocal <args>
endif

CompilerSet makeprg=julia\ --project\ -e\ 'using Pkg; Pkg.test()'

CompilerSet errorformat=
			@ %o %f:%l

let &cpo = s:cpo_save
unlet s:cpo_save

I haven't tested this. I used other compiler plugin files in the vim source directory as reference. The help documentation for errorformat has a lot more options: https://vimhelp.org/quickfix.txt.html#errorformat.

@kdheepak kdheepak changed the title Support for errorfmt Support for errorformat Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant