Use user ns to avoid qualification
This commit is contained in:
parent
9e826faff4
commit
238b526cf2
@ -156,11 +156,11 @@ function! s:nrepl_eval(expr, ...) dict abort
|
|||||||
endfunction
|
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 = '(symbol (str "\n\b" (apply str (interleave (repeat "\n") (map 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]', 'ns': 'user', 'session': a:nrepl.session}).value[0], "\n\b\n"), 1, ""), "\n")
|
||||||
call a:nrepl.message({'op': 'eval', 'code': '(*1 1)', 'session': a:nrepl.session})
|
call a:nrepl.message({'op': 'eval', 'code': '(*1 1)', 'ns': 'user', 'session': a:nrepl.session})
|
||||||
call a:nrepl.message({'op': 'eval', 'code': '(*2 2)', 'session': a:nrepl.session})
|
call a:nrepl.message({'op': 'eval', 'code': '(*2 2)', 'ns': 'user', 'session': a:nrepl.session})
|
||||||
call a:nrepl.message({'op': 'eval', 'code': '(*3 3)', 'session': a:nrepl.session})
|
call a:nrepl.message({'op': 'eval', 'code': '(*3 3)', 'ns': 'user', 'session': a:nrepl.session})
|
||||||
return stacktrace
|
return stacktrace
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -1070,13 +1070,13 @@ function! s:Require(bang, echo, ns) abort
|
|||||||
if expand('%:e') ==# 'cljs'
|
if expand('%:e') ==# 'cljs'
|
||||||
let cmd = '(load-file '.s:str(tr(a:ns ==# '' ? fireplace#ns() : a:ns, '-.', '_/').'.cljs').')'
|
let cmd = '(load-file '.s:str(tr(a:ns ==# '' ? fireplace#ns() : a:ns, '-.', '_/').'.cljs').')'
|
||||||
else
|
else
|
||||||
let cmd = ('(clojure.core/require '.s:qsym(a:ns ==# '' ? fireplace#ns() : a:ns).' :reload'.(a:bang ? '-all' : '').')')
|
let cmd = ('(require '.s:qsym(a:ns ==# '' ? fireplace#ns() : a:ns).' :reload'.(a:bang ? '-all' : '').')')
|
||||||
endif
|
endif
|
||||||
if a:echo
|
if a:echo
|
||||||
echo cmd
|
echo cmd
|
||||||
endif
|
endif
|
||||||
try
|
try
|
||||||
call fireplace#session_eval(cmd)
|
call fireplace#session_eval(cmd, {'ns': fireplace#client().user_ns()})
|
||||||
return ''
|
return ''
|
||||||
catch /^Clojure:.*/
|
catch /^Clojure:.*/
|
||||||
return ''
|
return ''
|
||||||
@ -1349,7 +1349,7 @@ function! fireplace#capture_test_run(expr) abort
|
|||||||
\ . ' ((.getRawRoot #''clojure.test/report) m)))]'
|
\ . ' ((.getRawRoot #''clojure.test/report) m)))]'
|
||||||
\ . ' ' . a:expr . ')'
|
\ . ' ' . a:expr . ')'
|
||||||
let qflist = []
|
let qflist = []
|
||||||
let response = s:eval(expr, {'session': 0})
|
let response = s:eval(expr, {'session': 0, 'ns': fireplace#client().user_ns()})
|
||||||
if !has_key(response, 'out')
|
if !has_key(response, 'out')
|
||||||
return s:output_response(response)
|
return s:output_response(response)
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user