From aa63e1d79e2c1eba3a023dbbb3f8ced24b1d9bd9 Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Sun, 1 Dec 2013 19:05:07 +0200 Subject: [PATCH] Cleanup fo the racket checker. --- README.markdown | 6 +++--- plugin/syntastic/registry.vim | 1 + syntax_checkers/racket/racket.vim | 27 +++++++++++++++------------ 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/README.markdown b/README.markdown index 2e2d6439..b74073ef 100644 --- a/README.markdown +++ b/README.markdown @@ -31,9 +31,9 @@ Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata, Go, Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, LESS, Limbo, LISP, LLVM intermediate language, Lua, MATLAB, NASM, Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable -Object, Puppet, Python, reStructuredText, Ruby, Rust, SASS/SCSS, Scala, Slim, -Tcl, TeX, Twig, TypeScript, Vala, Verilog, VHDL, xHtml, XML, XSLT, YAML, z80, -Zope page templates, zsh. +Object, Puppet, Python, Racket, reStructuredText, Ruby, Rust, SASS/SCSS, Scala, +Slim, Tcl, TeX, Twig, TypeScript, Vala, Verilog, VHDL, xHtml, XML, XSLT, YAML, +z80, Zope page templates, zsh. ## Screenshot diff --git a/plugin/syntastic/registry.vim b/plugin/syntastic/registry.vim index e3e8f4e5..742e2e32 100644 --- a/plugin/syntastic/registry.vim +++ b/plugin/syntastic/registry.vim @@ -53,6 +53,7 @@ let s:defaultCheckers = { \ 'pod': ['podchecker'], \ 'puppet': ['puppet', 'puppetlint'], \ 'python': ['python', 'flake8', 'pylint'], + \ 'racket': ['racket'], \ 'rst': ['rst2pseudoxml'], \ 'ruby': ['mri'], \ 'rust': ['rustc'], diff --git a/syntax_checkers/racket/racket.vim b/syntax_checkers/racket/racket.vim index 9629e314..870b5790 100644 --- a/syntax_checkers/racket/racket.vim +++ b/syntax_checkers/racket/racket.vim @@ -19,29 +19,32 @@ let g:loaded_syntastic_racket_racket_checker=1 let s:save_cpo = &cpo set cpo&vim -function! SyntaxCheckers_racket_racket_IsAvailable() dict - return executable(self.getExec()) -endfunction - " at some point put in the GetHightlightRegex(item) callback function! SyntaxCheckers_racket_racket_GetLocList() dict - let makeprg = self.makeprgBuild({'args': ''}) + let makeprg = self.makeprgBuild({}) " example of error message "eval-apply.rkt:460:30: the-empty-environment: unbound identifier in module " in: the-empty-environment - let errorformat = '%f:%l:%c: %m' + let errorformat = '%f:%l:%v: %m' - return SyntasticMake({ - \ 'makeprg': makeprg, - \ 'errorformat': errorformat }) + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + for e in loclist + if has_key(e, 'col') + let e['col'] += 1 + endif + endfor + + return loclist endfunction call g:SyntasticRegistry.CreateAndRegisterChecker({ - \ 'filetype': 'racket', - \ 'exec': 'racket', - \ 'name': 'racket'}) + \ 'filetype': 'racket', + \ 'name': 'racket'}) let &cpo = s:save_cpo unlet s:save_cpo