1 unstable release
new 0.0.2 | Mar 19, 2025 |
---|
#2842 in Parser implementations
104 downloads per month
385KB
11K
SLoC
tree-sitter-javadoc
Javadoc grammar for tree-sitter
About
Features:
- Complete old-school HTML (
/**
) - Basic new-school Markdown (
///
) support - Highlight queries, especially for those important/pesky
@see
and@link
references @nospell
set for javadocs syntax regions, so you don't have to turn spellcheck off anymore- Injection queries for
@snippet
,@value
- Tested on heaps of java code, popular open source codebases
- Not perfect, but javadocs parsing is a dirty business
Screenshot of highlighting:
lib.rs
:
This crate provides Javadoc language support for the tree-sitter parsing library.
Typically, you will use the [LANGUAGE][] constant to add this language to a tree-sitter Parser, and then use the parser to parse some code:
let code = r#"
"#;
let mut parser = tree_sitter::Parser::new();
let language = tree_sitter_javadoc::LANGUAGE;
parser
.set_language(&language.into())
.expect("Error loading Javadoc parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());
Dependencies
~4–280KB