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
@seeand@linkreferences @nospellset for javadocs syntax regions, so you don't have to turn spellcheck off anymore- Injection queries for
@snippet,@value - Support for custom inline and block doclet tags
- Tested on heaps of java code, popular open source codebases
- Not perfect, but javadocs parsing is a dirty business
Neovim Installation (for use in your editor)
Install nvim-treesitter, then from neovim:
:TSInstall java javadoc html css printf comment
It is recommended to install at least these parsers for treesitter support of java code.
Bindings Installation (for development)
Bindings are published to pypi, npm, and crates.io as tree-sitter-javadoc.
Wasm and source code artifacts are published to GitHub releases
Customize
You can customize highlighting by creating custom query files in ~/.config/nvim/queries/:
Example customization: conventions-based highlighting
This ;; extends the default queries, and adds additional queries based on standard coding conventions.
Many treesitter parsers do this, including java, but neovim is trying to move away from it.
If you use an LSP with semantic token support, you don't need this. Otherwise, it might be useful to you.
~/.config/nvim/queries/javadoc/highlights.scm:
;; extends
; Capitalized methods in javadoc references are treated as constructors.
(((method
(identifier) @constructor)
(#lua-match? @constructor "^[A-Z]")))
; Screaming-case members are treated as constants.
((member
(identifier) @constant)
(#lua-match? @constant "^[A-Z_][A-Z0-9_]+$"))
; Camel-case members are treated as types.
((member
(identifier) @type)
(#lua-match? @type "^[A-Z].*[a-z]"))
Example customization: disable HTML and markdown highlighting
The default highlighting incorporates highlighting of HTML and markdown tags via their respective parsers. For a more minimal approach with just highlighting of block and inline tags, you can override the injections.
~/.config/nvim/queries/javadoc/injections.scm:
; overriding with an empty query file to disable injections
Screenshot of highlights
Metadata
Release files for tree-sitter-javadoc 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tree_sitter_javadoc-0.3.1.tar.gz | 44.7 kB | Details |
Built distributions (wheels)
Total release size: 379.2 kB
Release files / tree_sitter_javadoc-0.3.1.tar.gz
| Download URL | tree_sitter_javadoc-0.3.1.tar.gz |
|---|---|
| Size | 44.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6b6748288f6ddad8c0a0cd4f38eb00eec613c0151019c63c554df6d39a35a59
|
|
BLAKE2b-256 checksum How to use checksums |
284b5a525f8fc56728fc7f586af7e81a5d4996c6c5d628f198f6313f9c15feed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_javadoc-0.3.1-cp310-abi3-win_arm64.whl
| Download URL | tree_sitter_javadoc-0.3.1-cp310-abi3-win_arm64.whl |
|---|---|
| Size | 36.9 kB |
| Tags | CPython 3.10 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
437580be85b3695348fd110fda53189d6608223debdf259e4b3f799aa3ce7646
|
|
BLAKE2b-256 checksum How to use checksums |
c44d1e247d8d5c91d44ea28efd8a7e6d4df86c11092f34c0c4a4429a54e5754a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_javadoc-0.3.1-cp310-abi3-win_amd64.whl
| Download URL | tree_sitter_javadoc-0.3.1-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 38.9 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
89dac069a43fdd1e6415fa6412c2237667850796f30f518376007f5da43aefb5
|
|
BLAKE2b-256 checksum How to use checksums |
9813cf38ef227d60e21c8131cdb9ef8586b587fbfb18059f9c00dfcf21464b70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_javadoc-0.3.1-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | tree_sitter_javadoc-0.3.1-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 46.5 kB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
f6e66031131cb392459ab9e2fc952a64ebbb8ffae1e2867e71392d54ee1b54f8
|
|
BLAKE2b-256 checksum How to use checksums |
62ca1cbe41b3642b93f60055448370e298d7f1b4e52df3888c0e9737930ff203
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_javadoc-0.3.1-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | tree_sitter_javadoc-0.3.1-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 46.5 kB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
835bcf30be0d705340b2febd8f0adffe023fc344c40e99d66f60e98ad63ded21
|
|
BLAKE2b-256 checksum How to use checksums |
56a3e6af6cb0bc31347e17ce5aba85e5b3fff7f0aa6b6a8d3abc8a53d658497d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_javadoc-0.3.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
| Download URL | tree_sitter_javadoc-0.3.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 47.0 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
fcc1bc7bdca8faf5a3bc53a73babebb4ffb7d61cba6c52c919fe666bc369113f
|
|
BLAKE2b-256 checksum How to use checksums |
412242cda1e5cff1da88655a534b96f67a5ec8e0bd1c41e876cd52878c55e1ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_javadoc-0.3.1-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | tree_sitter_javadoc-0.3.1-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 46.5 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
a3941aa3161f48575b50ec3de415dfe76d77a1cb4cf6c273aae13ad177fb1aa2
|
|
BLAKE2b-256 checksum How to use checksums |
cd7e340b8dee126ee5fb74d9dcaeefce42ea804538bf7071ca377a42ff777579
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_javadoc-0.3.1-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | tree_sitter_javadoc-0.3.1-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 36.8 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
bde4ea1491eaf8b90e2221f43fdc77b520c89dfbeb4f4dc2e858f46954c9dce9
|
|
BLAKE2b-256 checksum How to use checksums |
8fdf2c5a91fb40542511fdbabe7f94d366ba82cc99f65f48a13337259af64e8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_javadoc-0.3.1-cp310-abi3-macosx_10_9_x86_64.whl
| Download URL | tree_sitter_javadoc-0.3.1-cp310-abi3-macosx_10_9_x86_64.whl |
|---|---|
| Size | 35.3 kB |
| Tags | CPython 3.10 abi3 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
9741ac5846e8e6ab7877823b359f8a5ad74e8f21daf88e787f34c4942a7148d6
|
|
BLAKE2b-256 checksum How to use checksums |
22fbfdeffe68f76f27cb61f89c032ac4d7aaed2703d51ca7d207130782a6bdcb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|