syntax checker is not loading - please help

30 views
Skip to first unread message

Rick Veens

unread,
Apr 8, 2017, 6:06:52 PM4/8/17
to vim-syntastic
Hi, 

I'm trying to write a synastic_checker for a language called ALF, the checker tool is named sweet.
I cannot get my checker to load. I did the following:

- Made the file sweet.vim in syntastic/syntax_checkers/alf/
- Added the following line to the default checkers syntastic/plugin/syntastic/registry.vim:
        \ 'alf':         ['sweet'],


:SyntasticInfo output:
Syntastic version: 3.8.0-38 (Vim 704, Linux, GUI)
Info for filetype: alf
Global mode: active
Filetype alf is active
The current file will be checked automatically
Available checkers: -
Currently enabled checkers: -
Press ENTER or type command to continue

Could anyone please give me a hand? I am new to this.

Best regards,

Rick Veens


P.S: The contents of my checker file are as follows:

if exists('g:loaded_syntastic_alf_sweet_checker')
    finish
endif
let g:loaded_syntastic_alf_sweet_checker = 1

let s:save_cpo = &cpo
set cpo&vim

function! SyntaxCheckers_alf_sweet_IsAvailable() dict
    if !exists('g:syntastic_alf_compiler')
        let g:syntastic_alf_compiler = executable(self.getExec())
    endif
    call self.log('g:syntastic_alf_compiler =', g:syntastic_alf_compiler)
    return executable(expand(g:syntastic_alf_compiler, 1))
endfunction

" function! SyntaxCheckers_ruby_mri_GetHighlightRegex(item)
"     if match(a:item['text'], 'assigned but unused variable') > -1
"         let term = split(a:item['text'], ' - ')[1]
"         return '\V\\<'.term.'\\>'
"     endif

"     return ''
" endfunction

function! SyntaxCheckers_alf_sweet_GetLocList() dict
    " let makeprg = self.makeprgBuild({
    "             \ 'args_after': '-i=' })

" let errorformat = '%EAt %l.%c-%l.%c:'

    return syntastic#c#GetLocList('alf', 'sweet', {
        \ 'errorformat':
        \     'At %l.%c-%l.%c:',
        \ 'main_flags': '-i=' . syntastic#util#DevNull() })
    " return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat})
endfunction

call g:SyntasticRegistry.CreateAndRegisterChecker({
            \ 'filetype': 'alf',
            \ 'name': 'sweet' })

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: set sw=4 sts=4 et fdm=marker:

Rick Veens

unread,
Apr 9, 2017, 12:01:08 PM4/9/17
to vim-syntastic

I seem to have made an error here:

function! SyntaxCheckers_alf_sweet_IsAvailable() dict
    if !exists('g:syntastic_alf_compiler')
        let g:syntastic_alf_compiler = executable(self.getExec())
    endif
    call self.log('g:syntastic_alf_compiler =', g:syntastic_alf_compiler)
    return executable(expand(g:syntastic_alf_compiler, 1))
endfunction

Where

let g:syntastic_alf_compiler = executable(self.getExec()) 

Had to be

let g:syntastic_alf_compiler = self.getExec()

I don't know why. I am new to vimscript. Maybe this can help someone in the future.


Op zondag 9 april 2017 00:06:52 UTC+2 schreef Rick Veens:

LCD 47

unread,
Apr 10, 2017, 1:55:11 AM4/10/17
to vim-syntastic
On 9 April 2017, Rick Veens <rickv...@gmail.com> wrote:
>
>
> I seem to have made an error here:
>
> function! SyntaxCheckers_alf_sweet_IsAvailable() dict
> if !exists('g:syntastic_alf_compiler')
> let g:syntastic_alf_compiler = executable(self.getExec())
> endif
> call self.log('g:syntastic_alf_compiler =', g:syntastic_alf_compiler)
> return executable(expand(g:syntastic_alf_compiler, 1))
> endfunction
>
> Where
>
> let g:syntastic_alf_compiler = executable(self.getExec())
>
> Had to be
>
> let g:syntastic_alf_compiler = self.getExec()
>
> I don't know why. I am new to vimscript. Maybe this can help someone in the
> future.

Please post questions related to syntastic development to the issue
tracker at GitHub.

Followups:

https://github.com/vim-syntastic/syntastic/pull/2000

/lcd
Reply all
Reply to author
Forward
0 new messages