the caas service is fully integrated now.
this commit enables it by default if your project has a nimrod.cfg config, but the results won't be satisfactory as the compiler still cannot survive the long- running interaction with the IDE and breaks after a couple of commands.
This commit is contained in:
parent
43696ec2e3
commit
ffc49b7c2a
2 changed files with 27 additions and 13 deletions
|
|
@ -1,11 +1,34 @@
|
|||
let g:nimrod_log = []
|
||||
let s:plugin_path = escape(expand('<sfile>:p:h'), ' \')
|
||||
|
||||
if !exists("g:nimrod_caas_enabled")
|
||||
let g:nimrod_caas_enabled = 1
|
||||
endif
|
||||
|
||||
exe 'pyfile ' . fnameescape(s:plugin_path) . '/nimrod_vim.py'
|
||||
|
||||
if !executable('nimrod')
|
||||
echoerr "the nimrod compiler must be in your system's PATH"
|
||||
endif
|
||||
|
||||
fun! nimrod#init()
|
||||
let b:nimrod_project_root = "/foo"
|
||||
let b:nimrod_caas_enabled = 0
|
||||
let cmd = printf("nimrod --dump.format:json --verbosity:0 dump %s", s:CurrentNimrodFile())
|
||||
let raw_dumpdata = system(cmd)
|
||||
if !v:shell_error
|
||||
" the silent bit is to ignore a warning about trailing characters
|
||||
let dumpdata = eval(substitute(raw_dumpdata, "\n", "", "g"))
|
||||
|
||||
let b:nimrod_project_root = dumpdata['project_path']
|
||||
let b:nimrod_caas_enabled = g:nimrod_caas_enabled
|
||||
|
||||
for path in dumpdata['lib_paths']
|
||||
if finddir(path) == path
|
||||
let &l:path = path . "," . &l:path
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
let b:nimrod_caas_enabled = 0
|
||||
endif
|
||||
endf
|
||||
|
||||
fun! s:UpdateNimLog()
|
||||
|
|
@ -27,6 +50,8 @@ augroup NimLog
|
|||
au BufEnter log://nimrod call s:UpdateNimLog()
|
||||
augroup END
|
||||
|
||||
command! NimLog :e log://nimrod
|
||||
|
||||
fun! s:CurrentNimrodFile()
|
||||
let save_cur = getpos('.')
|
||||
call cursor(0, 0, 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue