Skip to main content

Module source_jars

Module source_jars 

Source
Expand description

On-demand source JAR documentation extractor.

Extracts Javadoc/KDoc/Scaladoc comments from source JARs when requested for hover information. Results are cached in an LRU cache to avoid re-reading JARs.

§Usage

use sqry_classpath::resolve::source_jars::SourceJarProvider;
use sqry_classpath::resolve::ClasspathEntry;

let provider = SourceJarProvider::new(&entries, 1000);
let docs = provider.get_docs("com.google.common.collect.ImmutableList", jar_path);

§Source file location

Given FQN com.example.MyClass, the source file is located at com/example/MyClass.java within the source JAR. For Kotlin and Scala, .kt and .scala extensions are tried as fallbacks.

§Doc comment extraction

Extracts /** ... */ Javadoc-style blocks and converts to plain text by:

  • Stripping leading * from each line
  • Converting HTML tags (<p>, <code>, <pre>) to plain text equivalents
  • Converting inline tags ({@code ...}, {@link ...}) to readable form
  • Formatting block tags (@param, @return, @throws) for display

Structs§

SourceJarProvider
On-demand source JAR documentation extractor.