A universal quickfix toolkit and its protocol.
It's fixing inside your text editor/IDE the warnings or errors returned by the compiler/interpreter.
The core of sarsi is a simple binary protocol to exchange quickfix messages. The tooling built around it approach the operating system as an integrated development environment following the Unix philosophy. On one side we produce messages from our build tools or interpreters, and on the other we want them to be consumed as soon as possible by our favorite text editors.
srs
- Command line wrapper for build tools (Haskell, Nix, Rust, Scala)sarsi
- Generic utility processing stdin (all supported languages)
sarsi-nvim
- Neovim RPC plugin for realtime feedback and multilines error displaysarsi-vi
- Quickfix file generator which use a vi compatible error format
Sarsi is published on Hackage and can be installed using cabal
.
cabal install sarsi
Alternatively, it can be installed from source using stack
.
git clone https://github.com/aloiscochard/sarsi.git
cd sarsi
stack install
By default, when a consumer/producer start it will use a Unix pipe with a name generated according the directory in which it was launched.
It means you have to start consumers/producers from the same directory for them to be connected.
It does allow you to run an arbitrary command and get it's output transparently feeded into all active consumers.
Languages: C/C++ (gcc), Haskell (cabal, stack, ghc), Nix (nix-*), Rust (cargo), Scala (sbt >= 1.14).
The srs
command line wrapper is generic and can be used with any build tool.
srs cabal build
It works nicely with velox, entr, inotifywait
, or any other hook mechanism you would like to use to trigger the build automatically when the code change.
vlx srs cargo build
In some special case you might prefer using the command tool sarsi
which process stdin and can be used in a pipeline.
cargo build |& sarsi
You can also specific a specific language by using adding its extension when calling sarsi
.
cargo build |& sarsi rs
Once sarsi
installed, add the following line in your init.vim
.
let g:sarsi = jobstart(['sarsi-nvim'], {'rpc': v:true})
You might also want to add key bindings for the core functionatilites as shown below.
noremap <silent> <C-F> :cfirst<CR>
noremap <silent> <C-J> :cnext<CR>
noremap <silent> <C-K> :cprevious<CR>
First, you have to start the consumer in a dedicated terminal using the sarsi-vi
command.
The process will continuously maintain a quickfix file located at $(sarsi --topic).vi
which you can open in the editor using :cfile `sarsi --topic`.vi
.
The output format used by sarsi-vi
to generate the $(sarsi --topic).vi
file is backward compatible with the default one used by vi
/vim
.
The missing part is the level (warning/error), in order to have it taken into account you should add the following in your initialization script.
set efm=%f:%l:%c:%t\ %m