diff options
author | Dan Loman <daniel.h.loman@gmail.com> | 2019-04-08 08:25:30 -0700 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2019-04-08 16:25:30 +0100 |
commit | 864d0861e47568ca5e69c9cba82af655730ae0d7 (patch) | |
tree | 002fd2d5c44212694786baa19a19c9392a79c2b4 /autoload | |
parent | 9a0ece1ecb4cddf9eebbc5bfa224764c4b5ad670 (diff) | |
download | ale-864d0861e47568ca5e69c9cba82af655730ae0d7.zip |
[lsp] Add Swift / SourceKit-LSP support (#2420)
* [linter] Add LSP support for Swift via sourcekit-lsp
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 |