Last active
August 29, 2015 14:17
-
-
Save yamaya/c0e844ec478d62cbc7db to your computer and use it in GitHub Desktop.
watchdogs.vim support swift.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if executable('swiftc') && get(get(g:, 'iOS_SDK'), 'path') != '' " {{{ | |
function! g:Watchdogs_swift_findfiles() | |
let s = '' | |
try | |
let dir = substitute(system('git rev-parse --show-toplevel'), '\n', '', 'g') | |
execute 'lcd! ' . dir | |
let files = systemlist('git ls-files --exclude-standard |grep ".swift$" |grep --invert "^.*Tests/"') " TODO: XCTests | |
let s = join(map(files, 'l:dir."/".v:val'), ' ') | |
catch | |
echoms v:exception | |
endtry | |
return s | |
endfunction | |
let g:quickrun_config['watchdogs_checker/swiftc'] = { | |
\ 'command': 'swiftc' | |
\, 'exec': '%c -target i386-apple-ios8.2 -target-cpu yonah -parse %{g:Watchdogs_swift_findfiles()} -sdk ' . g:iOS_SDK.path . ' -Onone' | |
\, 'errorformat': | |
\ '%E%f:%l:%c: error: %m,' | |
\ . '%W%f:%l:%c: warning: %m,' | |
\ . '%Z%\s%#^~%#,' | |
\ . '%-G%.%#' | |
\} | |
let g:quickrun_config['swift/watchdogs_checker'] = { | |
\ 'type': 'watchdogs_checker/swiftc' | |
\, 'hook/read_swift_option/enable': 1 | |
\} | |
endif " }}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment