]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/ale_linters/glsl/glslls.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:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / ale_linters / glsl / glslls.vim
1 " Author: Sven-Hendrik Haase <svenstaro@gmail.com>
2 " Description: A language server for glsl
3
4 call ale#Set('glsl_glslls_executable', 'glslls')
5 call ale#Set('glsl_glslls_logfile', '')
6
7 function! ale_linters#glsl#glslls#GetCommand(buffer) abort
8     let l:logfile = ale#Var(a:buffer, 'glsl_glslls_logfile')
9     let l:logfile_args = ''
10
11     if l:logfile isnot# ''
12         let l:logfile_args = ' --verbose -l ' . l:logfile
13     endif
14
15     return '%e' . l:logfile_args . ' --stdin'
16 endfunction
17
18 function! ale_linters#glsl#glslls#GetProjectRoot(buffer) abort
19     let l:project_root = ale#c#FindProjectRoot(a:buffer)
20
21     return !empty(l:project_root) ? fnamemodify(l:project_root, ':h:h') : ''
22 endfunction
23
24 call ale#linter#Define('glsl', {
25 \   'name': 'glslls',
26 \   'lsp': 'stdio',
27 \   'executable': {b -> ale#Var(b, 'glsl_glslls_executable')},
28 \   'command': function('ale_linters#glsl#glslls#GetCommand'),
29 \   'project_root': function('ale_linters#glsl#glslls#GetProjectRoot'),
30 \})