diff options
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/swift.vim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/autoload/ale/swift.vim b/autoload/ale/swift.vim new file mode 100644 index 00000000..b31b8dc5 --- /dev/null +++ b/autoload/ale/swift.vim @@ -0,0 +1,13 @@ +" Author: Dan Loman <https://github.com/namolnad> +" Description: Functions for integrating with Swift tools + +" Find the nearest dir containing a Package.swift file and assume it is the root of the Swift project. +function! ale#swift#FindProjectRoot(buffer) abort + let l:swift_config = ale#path#FindNearestFile(a:buffer, 'Package.swift') + + if !empty(l:swift_config) + return fnamemodify(l:swift_config, ':h') + endif + + return '' +endfunction |