Make client responsible for knowing class path

This commit is contained in:
Tim Pope 2013-01-03 19:10:38 -05:00
parent 3fa8d8396f
commit 3ff1633daa

View File

@ -66,7 +66,7 @@ endfunction
function! foreplay#ns_complete(A, L, P) abort function! foreplay#ns_complete(A, L, P) abort
let matches = [] let matches = []
for dir in classpath#split(classpath#from_vim(&path)) for dir in foreplay#client().path()
if dir =~# '\.jar$' if dir =~# '\.jar$'
let files = filter(foreplay#jar_contents(dir), 'v:val =~# "\\.clj$"') let files = filter(foreplay#jar_contents(dir), 'v:val =~# "\\.clj$"')
else else
@ -141,6 +141,10 @@ function! s:qsym(symbol)
endif endif
endfunction endfunction
function! s:repl.path() dict abort
return self.connection.path()
endfunction
function! s:repl.eval(expr, ns) dict abort function! s:repl.eval(expr, ns) dict abort
try try
let result = self.connection.eval(a:expr, a:ns) let result = self.connection.eval(a:expr, a:ns)
@ -164,7 +168,7 @@ endfunction
function! s:repl.includes_file(file) dict abort function! s:repl.includes_file(file) dict abort
let file = substitute(a:file, '\C^zipfile:\(.*\)::', '\1/', '') let file = substitute(a:file, '\C^zipfile:\(.*\)::', '\1/', '')
for path in self.connection.path() for path in self.path()
if file[0 : len(path)-1] ==? path if file[0 : len(path)-1] ==? path
return 1 return 1
endif endif
@ -272,6 +276,10 @@ endif
let s:oneoff = {} let s:oneoff = {}
function! s:oneoff.path() dict abort
return classpath#split(classpath#from_vim(self.classpath))
endfunction
let s:oneoff_pr = tempname() let s:oneoff_pr = tempname()
let s:oneoff_ex = tempname() let s:oneoff_ex = tempname()
let s:oneoff_stk = tempname() let s:oneoff_stk = tempname()