Cleaner classpath retrieval
This commit is contained in:
parent
2dec3b49b2
commit
bc8f3af299
@ -33,14 +33,15 @@ function! fireplace#nrepl#for(transport) abort
|
|||||||
let client = copy(s:nrepl)
|
let client = copy(s:nrepl)
|
||||||
let client.transport = a:transport
|
let client.transport = a:transport
|
||||||
let client.session = client.process({'op': 'clone', 'session': 0})['new-session']
|
let client.session = client.process({'op': 'clone', 'session': 0})['new-session']
|
||||||
let response = client.process({'op': 'eval', 'code':
|
let client.describe = client.process({'op': 'describe', 'verbose?': 1})
|
||||||
\ '(do (println "success") (symbol (str (System/getProperty "path.separator") (System/getProperty "java.class.path"))))'})
|
if client.describe.versions.nrepl.major == 0 &&
|
||||||
let client._path = response.value[-1]
|
\ client.describe.versions.nrepl.minor < 2
|
||||||
if has_key(response, 'out')
|
throw 'nREPL: 0.2.0 or higher required'
|
||||||
let g:fireplace_nrepl_sessions[client.session] = client
|
|
||||||
else
|
|
||||||
unlet client.session
|
|
||||||
endif
|
endif
|
||||||
|
let response = client.process({'op': 'eval', 'code':
|
||||||
|
\ '[(System/getProperty "path.separator") (System/getProperty "java.class.path")]', 'session': ''})
|
||||||
|
let client._path = split(eval(response.value[-1][5:-2]), response.value[-1][2])
|
||||||
|
let g:fireplace_nrepl_sessions[client.session] = client
|
||||||
return client
|
return client
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -68,7 +69,7 @@ function! s:nrepl_clone() dict abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:nrepl_path() dict abort
|
function! s:nrepl_path() dict abort
|
||||||
return split(self._path[1:-1], self._path[0])
|
return self._path
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fireplace#nrepl#combine(responses)
|
function! fireplace#nrepl#combine(responses)
|
||||||
@ -157,9 +158,9 @@ endfunction
|
|||||||
function! s:extract_last_stacktrace(nrepl) abort
|
function! s:extract_last_stacktrace(nrepl) abort
|
||||||
let format_st = '(clojure.core/symbol (clojure.core/str "\n\b" (clojure.core/apply clojure.core/str (clojure.core/interleave (clojure.core/repeat "\n") (clojure.core/map clojure.core/str (.getStackTrace *e)))) "\n\b\n"))'
|
let format_st = '(clojure.core/symbol (clojure.core/str "\n\b" (clojure.core/apply clojure.core/str (clojure.core/interleave (clojure.core/repeat "\n") (clojure.core/map clojure.core/str (.getStackTrace *e)))) "\n\b\n"))'
|
||||||
let stacktrace = split(get(split(a:nrepl.process({'op': 'eval', 'code': '['.format_st.' *3 *2 *1]', 'session': a:nrepl.session}).value[0], "\n\b\n"), 1, ""), "\n")
|
let stacktrace = split(get(split(a:nrepl.process({'op': 'eval', 'code': '['.format_st.' *3 *2 *1]', 'session': a:nrepl.session}).value[0], "\n\b\n"), 1, ""), "\n")
|
||||||
call a:nrepl.message({'op': 'eval', 'code': '(nth *1 1)', 'session': a:nrepl.session})
|
call a:nrepl.message({'op': 'eval', 'code': '(*1 1)', 'session': a:nrepl.session})
|
||||||
call a:nrepl.message({'op': 'eval', 'code': '(nth *2 2)', 'session': a:nrepl.session})
|
call a:nrepl.message({'op': 'eval', 'code': '(*2 2)', 'session': a:nrepl.session})
|
||||||
call a:nrepl.message({'op': 'eval', 'code': '(nth *3 3)', 'session': a:nrepl.session})
|
call a:nrepl.message({'op': 'eval', 'code': '(*3 3)', 'session': a:nrepl.session})
|
||||||
return stacktrace
|
return stacktrace
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -1477,7 +1477,9 @@ function! s:leiningen_connect(auto) abort
|
|||||||
let cwd = getcwd()
|
let cwd = getcwd()
|
||||||
try
|
try
|
||||||
execute cd fnameescape(b:leiningen_root)
|
execute cd fnameescape(b:leiningen_root)
|
||||||
Start! -title=lein\ repl lein repl
|
execute 'Start! -title='
|
||||||
|
\ . escape(fnamemodify(b:leiningen_root, ':t') . ' repl', ' ')
|
||||||
|
\ 'lein repl'
|
||||||
if get(get(g:, 'dispatch_last_start', {}), 'handler', 'headless') ==# 'headless'
|
if get(get(g:, 'dispatch_last_start', {}), 'handler', 'headless') ==# 'headless'
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user