From 5866d0017a7f544a27c3f60045958d6d7759b1a8 Mon Sep 17 00:00:00 2001 From: Joshua Davey Date: Sat, 14 Feb 2015 20:19:12 -0600 Subject: [PATCH] Add support for boot 2.0 and up Boot's built-in repl task adds a fake.class.path System property which refers back to the original user files (as opposed to the temporary files it uses to actually do builds). We should prefer that to anything else when the property is set. Fixes #194. --- autoload/fireplace/nrepl.vim | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/autoload/fireplace/nrepl.vim b/autoload/fireplace/nrepl.vim index 617b478..5d081e7 100644 --- a/autoload/fireplace/nrepl.vim +++ b/autoload/fireplace/nrepl.vim @@ -38,7 +38,17 @@ function! fireplace#nrepl#for(transport) abort \ client.describe.versions.nrepl.minor < 2 throw 'nREPL: 0.2.0 or higher required' endif - if client.has_op('classpath') + " Handle boot, which sets a fake.class.path entry + let response = client.process({'op': 'eval', 'code': + \ '[(System/getProperty "path.separator") (System/getProperty "fake.class.path")]', 'session': ''}) + let cpath = response.value[-1][5:-2] + if cpath !=# 'nil' + let cpath = eval(cpath) + if !empty(cpath) + let client._path = split(cpath, response.value[-1][2]) + endif + endif + if !has_key(client, '_path') && client.has_op('classpath') let response = client.message({'op': 'classpath'})[0] if type(get(response, 'classpath')) == type([]) let client._path = response.classpath