Closed mikepjb closed 5 years ago
How can I test this? I checked fireplace#info('System/getProperty')
and it has no file or resource attribute. What's a Java method that does?
I've been using echo fireplace#info('Runtime/getRuntime')
I am getting both file and resource for System/getProperty
and Runtime/getRuntime
What system are you using?
Tried on Ubuntu:
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu219.04)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu219.04, mixed mode, sharing)
And on macOS:
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
Do you have openjdk-11-source
installed on Ubuntu?
I just uninstalled the source package from my machine and found that Runtime/getRuntime
no longer returns file or resource when the source package is removed.
:+1:. This is good to go. Just wanted to get the context so I can investigate the #findresource()
side of things in the future.
No problem, glad I could help :+1:
As an aside, without these changes the cider-nrepl info op was never returning any useful information as the 'ns'
wasn't set for it to lookup details about the symbol.
@SevereOverfl0w I believe 'ns' is set inside fireplace#message on L1064 of the autoload/fireplace.vim file
function! fireplace#message(payload, ...) abort
let client = fireplace#client()
let payload = copy(a:payload)
if !has_key(payload, 'ns')
let payload.ns = v:true
endif
return call(client.message, [payload] + a:000, client)
endfunction
This change passes through ns when making the call to info and handles the case when referenced code is included on the classpath as a zip file (typical for java source e.g
/usr/lib/jvm/java-10-openjdk/src.zip
)This should mean that you can jump to java source code using FireplaceDJump (I've tested this on Vim 8.1 with patches 1-1776 and Neovim v0.3.8)
Special thanks to @SevereOverfl0w for helping put this together with me :1st_place_medal: