]> git.madduck.net Git - etc/vim.git/blob - ale_linters/kotlin/languageserver.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] / ale_linters / kotlin / languageserver.vim
1 " Author: MTDL9 <https://github.com/MTDL9>
2 " Description: Support for the Kotlin language server https://github.com/fwcd/KotlinLanguageServer
3
4 call ale#Set('kotlin_languageserver_executable', 'kotlin-language-server')
5
6 function! ale_linters#kotlin#languageserver#GetProjectRoot(buffer) abort
7     let l:gradle_root = ale#gradle#FindProjectRoot(a:buffer)
8
9     if !empty(l:gradle_root)
10         return l:gradle_root
11     endif
12
13     let l:maven_pom_file = ale#path#FindNearestFile(a:buffer, 'pom.xml')
14
15     if !empty(l:maven_pom_file)
16         return fnamemodify(l:maven_pom_file, ':h')
17     endif
18
19     return ''
20 endfunction
21
22 call ale#linter#Define('kotlin', {
23 \   'name': 'languageserver',
24 \   'aliaes': ['kotlin_language_server'],
25 \   'lsp': 'stdio',
26 \   'executable': {b -> ale#Var(b, 'kotlin_languageserver_executable')},
27 \   'command': '%e',
28 \   'language': 'kotlin',
29 \   'project_root': function('ale_linters#kotlin#languageserver#GetProjectRoot'),
30 \})