From e8ce1e08d04d97bf48239f21314592fd3869e69b Mon Sep 17 00:00:00 2001 From: Sean Clark Hess Date: Mon, 31 Aug 2015 14:58:31 -0600 Subject: [PATCH 1/3] Added Purescript language and Pulp syntax checker --- plugin/syntastic/registry.vim | 1 + syntax_checkers/purescript/pulp.vim | 48 +++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 syntax_checkers/purescript/pulp.vim diff --git a/plugin/syntastic/registry.vim b/plugin/syntastic/registry.vim index 27a3bd085..75d8b7c51 100644 --- a/plugin/syntastic/registry.vim +++ b/plugin/syntastic/registry.vim @@ -65,6 +65,7 @@ let s:_DEFAULT_CHECKERS = { \ 'po': ['msgfmt'], \ 'pod': ['podchecker'], \ 'puppet': ['puppet', 'puppetlint'], + \ 'purescript': ['pulp'], \ 'python': ['python', 'flake8', 'pylint'], \ 'qml': ['qmllint'], \ 'r': [], diff --git a/syntax_checkers/purescript/pulp.vim b/syntax_checkers/purescript/pulp.vim new file mode 100644 index 000000000..7d43daccf --- /dev/null +++ b/syntax_checkers/purescript/pulp.vim @@ -0,0 +1,48 @@ +"============================================================================ +"File: pulp.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Sean Hess +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists('g:loaded_syntastic_purescript_pulp_checker') + finish +endif +let g:loaded_syntastic_purescript_pulp_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_purescript_pulp_GetLocList() dict + + let makeprg = self.makeprgBuild({ + \ 'exe_after': 'build --main ', + \ 'fname': syntastic#util#shexpand('%:p') }) + + let errorformat = + \ '%E\\s%#\"%f\"%.%#,' . + \ '%E%.%#Error at %f line %l\, column %c - %.%#,'. + \ '%ZSee http%.%#,' . + \ '%C\\s%#%m,' . + \ '%Z' + + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'purescript', + \ 'name': 'pulp'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: From 6ce2468630785461aba9988db4770e2e367d1037 Mon Sep 17 00:00:00 2001 From: Sean Clark Hess Date: Mon, 31 Aug 2015 16:01:32 -0600 Subject: [PATCH 2/3] purescript-pulp: support error messages when project cannot be build at all --- syntax_checkers/purescript/pulp.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/syntax_checkers/purescript/pulp.vim b/syntax_checkers/purescript/pulp.vim index 7d43daccf..eca1821d5 100644 --- a/syntax_checkers/purescript/pulp.vim +++ b/syntax_checkers/purescript/pulp.vim @@ -27,7 +27,9 @@ function! SyntaxCheckers_purescript_pulp_GetLocList() dict let errorformat = \ '%E\\s%#\"%f\"%.%#,' . \ '%E%.%#Error at %f line %l\, column %c - %.%#,'. - \ '%ZSee http%.%#,' . + \ '%-G\* ERROR: Subcommand%.%#,' . + \ '\* ERROR: %m,' . + \ '%Z\\s%#See http%.%#,' . \ '%C\\s%#%m,' . \ '%Z' From 58e4d51076263dbaee4c7d389b72a51073cff581 Mon Sep 17 00:00:00 2001 From: Sean Clark Hess Date: Mon, 31 Aug 2015 17:14:02 -0600 Subject: [PATCH 3/3] purescript_pulp: discovered new error format --- syntax_checkers/purescript/pulp.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/syntax_checkers/purescript/pulp.vim b/syntax_checkers/purescript/pulp.vim index eca1821d5..743dd6be2 100644 --- a/syntax_checkers/purescript/pulp.vim +++ b/syntax_checkers/purescript/pulp.vim @@ -25,7 +25,9 @@ function! SyntaxCheckers_purescript_pulp_GetLocList() dict \ 'fname': syntastic#util#shexpand('%:p') }) let errorformat = - \ '%E\\s%#\"%f\"%.%#,' . + \ '%E\\s%#psc: %m,' . + \ '%C\\s%#at \"%f\" \(line %l\, column %c\)%.%#,' . + \ '%E\\s%#\"%f\" \(line %l\, column %c\)%.%#,' . \ '%E%.%#Error at %f line %l\, column %c - %.%#,'. \ '%-G\* ERROR: Subcommand%.%#,' . \ '\* ERROR: %m,' .