Hi all,

There is already quite a bit of Java and some Kotlin code in mozilla-central 
for GeckoView and that number should only increase as progress is made towards 
absorbing firefox-android.
It was already possible to browse that code from Searchfox obviously, but 
without most of the interesting features:
 * no Go to declaration/definition
 * no search for uses/subclasses/superclasses/overrides/...
 * no diagrams

All of that is now available for Java (and Kotlin) code too!

A few examples:
- A search for the 
org.mozilla.geckoview.GeckoSession.PromptDelegate.AutocompleteRequest class 
reveals a superclass, and a number of uses in both Java main source and Kotlin 
android tests.
  
https://searchfox.org/mozilla-central/search?q=symbol:S_java_java_org%2Fmozilla%2Fgeckoview%2FGeckoSession%23PromptDelegate%23AutocompleteRequest%23

- A search for the 
org.mozilla.geckoview.Autocomplete.StorageDelegate.onAddressFetch method links 
to a user in Java main code and a few overrides in Kotlin tests.
  
https://searchfox.org/mozilla-central/search?q=symbol:S_java_java_org%2Fmozilla%2Fgeckoview%2FAutocomplete%23StorageDelegate%23onAddressFetch().

- A query for all (transitive) callers to the method 
org::mozilla::geckoview::Autofill::Session::getDefaultDimensions with up to 2 
indirect calls
  
https://searchfox.org/mozilla-central/query/default?q=calls-to%3A%27org%3A%3Amozilla%3A%3Ageckoview%3A%3AAutofill%3A%3ASession%3A%3AgetDefaultDimensions%27+depth%3A2

On the technical side this is enabled by emitting SemanticDB files when 
building using javac/kotlinc compiler plugins[1;2] then turning that into an 
SCIP index using scip-java[1]. This SCIP index is then consumed just like the 
SCIP index that rust-analyzer produces for Rust code.
[1] https://github.com/sourcegraph/scip-java
[2] https://github.com/sourcegraph/scip-kotlin

The next step is to add support for the autogenerated JNI bindings so one may 
easily jump to/from Java code from/to C++ code.

Cheers,
--
Nicolas Guichard | [email protected] | Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel: France +33 (0)4 90 84 08 53, http://www.kdab.fr
KDAB - The Qt, C++ and OpenGL Experts

--
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/4506e6c2-41ef-4365-840a-b81dc10387ed%40kdab.com.

Reply via email to