2019-10-18 16:26:08 +00:00
|
|
|
" Author: Bartek Jasicki http://github.com/thindil
|
|
|
|
" Description: Support for Ada Language Server
|
|
|
|
|
|
|
|
call ale#Set('ada_adals_executable', 'ada_language_server')
|
2019-11-05 17:59:13 +00:00
|
|
|
call ale#Set('ada_adals_project', 'default.gpr')
|
2019-11-05 16:58:53 +00:00
|
|
|
call ale#Set('ada_adals_encoding', 'utf-8')
|
|
|
|
|
|
|
|
function! ale_linters#ada#adals#GetAdaLSConfig(buffer) abort
|
|
|
|
return {
|
|
|
|
\ 'ada.projectFile': ale#Var(a:buffer, 'ada_adals_project'),
|
|
|
|
\ 'ada.defaultCharset': ale#Var(a:buffer, 'ada_adals_encoding')
|
|
|
|
\}
|
|
|
|
endfunction
|
2019-10-18 16:26:08 +00:00
|
|
|
|
|
|
|
function! ale_linters#ada#adals#GetRootDirectory(buffer) abort
|
|
|
|
return fnamemodify(bufname(a:buffer), ':p:h')
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
call ale#linter#Define('ada', {
|
|
|
|
\ 'name': 'adals',
|
|
|
|
\ 'lsp': 'stdio',
|
|
|
|
\ 'executable': {b -> ale#Var(b, 'ada_adals_executable')},
|
|
|
|
\ 'command': '%e',
|
|
|
|
\ 'project_root': function('ale_linters#ada#adals#GetRootDirectory'),
|
2019-11-05 16:59:17 +00:00
|
|
|
\ 'lsp_config': function('ale_linters#ada#adals#GetAdaLSConfig')
|
2019-10-18 16:26:08 +00:00
|
|
|
\})
|