Skip to content

Commit

Permalink
Add support for boot 2.0 and up
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jgdavey authored and tpope committed Feb 15, 2015
1 parent 7cebf68 commit 5866d00
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion autoload/fireplace/nrepl.vim
Expand Up @@ -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
Expand Down

0 comments on commit 5866d00

Please sign in to comment.