Bram Moolenaar | 86b4816 | 2022-12-06 18:20:10 +0000 | [diff] [blame] | 1 | " Vim compiler file |
| 2 | " Compiler: dotnet build (.NET CLI) |
| 3 | " Maintainer: Nick Jensen <nickspoon@gmail.com> |
| 4 | " Last Change: 2022-12-06 |
| 5 | " License: Vim (see :h license) |
| 6 | " Repository: https://github.com/nickspoons/vim-cs |
| 7 | |
| 8 | if exists("current_compiler") |
| 9 | finish |
| 10 | endif |
| 11 | let current_compiler = "dotnet" |
| 12 | |
| 13 | if exists(":CompilerSet") != 2 " older Vim always used :setlocal |
| 14 | command -nargs=* CompilerSet setlocal <args> |
| 15 | endif |
| 16 | |
| 17 | let s:cpo_save = &cpo |
| 18 | set cpo&vim |
| 19 | |
| 20 | if get(g:, "dotnet_errors_only", v:false) |
| 21 | CompilerSet makeprg=dotnet\ build\ -nologo |
| 22 | \\ -consoleloggerparameters:NoSummary |
| 23 | \\ -consoleloggerparameters:ErrorsOnly |
| 24 | else |
| 25 | CompilerSet makeprg=dotnet\ build\ -nologo\ -consoleloggerparameters:NoSummary |
| 26 | endif |
| 27 | |
| 28 | if get(g:, "dotnet_show_project_file", v:true) |
| 29 | CompilerSet errorformat=%E%f(%l\\,%c):\ %trror\ %m, |
| 30 | \%W%f(%l\\,%c):\ %tarning\ %m, |
| 31 | \%-G%.%# |
| 32 | else |
| 33 | CompilerSet errorformat=%E%f(%l\\,%c):\ %trror\ %m\ [%.%#], |
| 34 | \%W%f(%l\\,%c):\ %tarning\ %m\ [%.%#], |
| 35 | \%-G%.%# |
| 36 | endif |
| 37 | |
| 38 | let &cpo = s:cpo_save |
| 39 | unlet s:cpo_save |