mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-14 22:21:52 +08:00
[lsp] Add Swift / SourceKit-LSP support (#2420)
* [linter] Add LSP support for Swift via sourcekit-lsp
This commit is contained in:
13
autoload/ale/swift.vim
Normal file
13
autoload/ale/swift.vim
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user