]> git.madduck.net Git - etc/vim.git/blob - autoload/ale/handlers/deadnix.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / autoload / ale / handlers / deadnix.vim
1 function! ale#handlers#deadnix#Handle(buffer, lines) abort
2     let l:output = []
3
4     for l:line in a:lines
5         try
6             let l:file = ale#util#FuzzyJSONDecode(l:line, v:null)
7         catch
8             continue
9         endtry
10
11         if type(l:file) isnot v:t_dict
12             continue
13         endif
14
15         for l:error in l:file['results']
16             try
17                 let l:ale_error = {
18                 \   'lnum': l:error['line'],
19                 \   'col': l:error['column'],
20                 \   'end_col': l:error['endColumn'],
21                 \   'text': l:error['message'],
22                 \   'type': 'W',
23                 \}
24             catch
25                 continue
26             endtry
27
28             call add(l:output, l:ale_error)
29         endfor
30     endfor
31
32     return l:output
33 endfunction