summaryrefslogtreecommitdiff
path: root/autoload/ale/d.vim
blob: 0e232203a9a74abc4f09ce22b1d84df6d8b581a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
" Author: Auri <me@aurieh.me>
" Description: Functions for integrating with D linters.

function! ale#d#FindDUBConfig(buffer) abort
    " Find a DUB configuration file in ancestor paths.
    " The most DUB-specific names will be tried first.
    for l:possible_filename in ['dub.sdl', 'dub.json', 'package.json']
        let l:dub_file = ale#path#FindNearestFile(a:buffer, l:possible_filename)

        if !empty(l:dub_file)
            return l:dub_file
        endif
    endfor

    return ''
endfunction