mirror of
https://github.com/dense-analysis/ale
synced 2024-12-18 20:35:29 +00:00
d6302d1858
This allows the location list from one buffer to point to an issue in another; previously, the error message would be shown but with no way to jump to it.
35 lines
1.1 KiB
VimL
35 lines
1.1 KiB
VimL
" Author: aqui18 <https://github.com/aqui18>
|
|
" Description: This file adds support for checking Racket code with raco.
|
|
" This is the same form of syntax-checking used by DrRacket as well. The
|
|
" downside is that it will only catch the first error, but none of the
|
|
" subsequent ones. This is due to how evaluation in Racket works.
|
|
|
|
function! ale_linters#racket#raco#Handle(buffer, lines) abort
|
|
" Matches patterns
|
|
" <file>:<line>:<column> <message>
|
|
" eg:
|
|
" info.rkt:4:0: infotab-module: not a well-formed definition
|
|
let l:pattern = '^\(\s\)\@!\(.\+\):\(\d\+\):\(\d\+\): \(.\+\)$'
|
|
let l:output = []
|
|
|
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
|
call add(l:output, {
|
|
\ 'filename': l:match[2],
|
|
\ 'lnum': l:match[3] + 0,
|
|
\ 'col': l:match[4] + 0,
|
|
\ 'type': 'E',
|
|
\ 'text': l:match[5],
|
|
\})
|
|
endfor
|
|
|
|
return l:output
|
|
endfunction
|
|
|
|
call ale#linter#Define('racket', {
|
|
\ 'name': 'raco',
|
|
\ 'executable': 'raco',
|
|
\ 'output_stream': 'stderr',
|
|
\ 'command': 'raco expand %s',
|
|
\ 'callback': 'ale_linters#racket#raco#Handle',
|
|
\})
|