]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/ale_linters/cpp/cquery.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 '294584081929424aec883f90c7d6515b3743358d' as '.vim/bundle/vim-lsp-ale'
[etc/vim.git] / .vim / bundle / ale / ale_linters / cpp / cquery.vim
1 " Author: Ben Falconer <ben@falconers.me.uk>
2 " Description: A language server for C++
3
4 call ale#Set('cpp_cquery_executable', 'cquery')
5 call ale#Set('cpp_cquery_cache_directory', expand('~/.cache/cquery'))
6
7 function! ale_linters#cpp#cquery#GetProjectRoot(buffer) abort
8     " Try to find cquery configuration files first.
9     let l:config = ale#path#FindNearestFile(a:buffer, '.cquery')
10
11     if !empty(l:config)
12         return fnamemodify(l:config, ':h')
13     endif
14
15     " Fall back on default project root detection.
16     return ale#c#FindProjectRoot(a:buffer)
17 endfunction
18
19 function! ale_linters#cpp#cquery#GetInitializationOptions(buffer) abort
20     return {'cacheDirectory': ale#Var(a:buffer, 'cpp_cquery_cache_directory')}
21 endfunction
22
23 call ale#linter#Define('cpp', {
24 \   'name': 'cquery',
25 \   'lsp': 'stdio',
26 \   'executable': {b -> ale#Var(b, 'cpp_cquery_executable')},
27 \   'command': '%e',
28 \   'project_root': function('ale_linters#cpp#cquery#GetProjectRoot'),
29 \   'initialization_options': function('ale_linters#cpp#cquery#GetInitializationOptions'),
30 \})