Skip to main content

Parser for Javadoc documentation comments

Project description

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
  • 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

Syntax highlighting screenshot

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tree_sitter_javadoc-0.2.4.tar.gz (43.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tree_sitter_javadoc-0.2.4-cp310-abi3-win_arm64.whl (35.4 kB view details)

Uploaded CPython 3.10+Windows ARM64

tree_sitter_javadoc-0.2.4-cp310-abi3-win_amd64.whl (37.1 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_javadoc-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl (44.6 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

tree_sitter_javadoc-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl (44.4 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

tree_sitter_javadoc-0.2.4-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (45.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

tree_sitter_javadoc-0.2.4-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (44.7 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

tree_sitter_javadoc-0.2.4-cp310-abi3-macosx_11_0_arm64.whl (35.1 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_javadoc-0.2.4-cp310-abi3-macosx_10_9_x86_64.whl (34.0 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

Details for the file tree_sitter_javadoc-0.2.4.tar.gz.

File metadata

  • Download URL: tree_sitter_javadoc-0.2.4.tar.gz
  • Upload date:
  • Size: 43.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tree_sitter_javadoc-0.2.4.tar.gz
Algorithm Hash digest
SHA256 2adc4b6bec6ce29847a0fe3ec7b0b72b86b3cb5d7dd64aa6759913c092e3fc9b
MD5 196ca88bccd59263a22064643d4deab3
BLAKE2b-256 3f42c4de89c4562bc538ee08025c2804a793bf37cf89454803af1b8488b1a6ec

See more details on using hashes here.

File details

Details for the file tree_sitter_javadoc-0.2.4-cp310-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_javadoc-0.2.4-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 44fde78a68342f9bdd822eb1f3d6254761dffd5f92b4768383153428927c66fa
MD5 727fc81f3078deff1f75caeb894c4a10
BLAKE2b-256 e93f0ae176d99591c541baa4a4daa00021c38ee90de435a2e44d8e896a4784a5

See more details on using hashes here.

File details

Details for the file tree_sitter_javadoc-0.2.4-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_javadoc-0.2.4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1fc954597b8e745d2bace2ecd9420db3bf87dac287ac64c90133340c1ff1155d
MD5 7eb53aa7781f2e51c10455c6eb001f2d
BLAKE2b-256 fed916f8d0c1316a0e1dc6a570412facbc37227d9cfe8c0558dda491f2c7cab8

See more details on using hashes here.

File details

Details for the file tree_sitter_javadoc-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_javadoc-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 eec0495d61504260f9abfa0d43c085cf098006143b01d08ef5a24932f2fe5e08
MD5 99b1d7553d3ec7795f6f513df7e3c58f
BLAKE2b-256 8eab412a093f4603f25ffffd475308cf78f4060ce3283db7e42138f2fd980ed5

See more details on using hashes here.

File details

Details for the file tree_sitter_javadoc-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_javadoc-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 3179e3ee68952487e44be7d51679094f8b51a2cd52adba2fd713f7f770666e63
MD5 654a35792e01eb2d3bab175127ec4238
BLAKE2b-256 d4e21d3dae7c721e4e6b9ac4c481832b2352f1f7e2142bfcd6f5f59eb984c242

See more details on using hashes here.

File details

Details for the file tree_sitter_javadoc-0.2.4-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_javadoc-0.2.4-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 545375fd173b51f0b723e692b4a7212e53a68e80894fd3ac30696b301823c2c4
MD5 d3080edf8b6e94b6c7583fa1033cc2a1
BLAKE2b-256 857958326008a12efa064b5ef79f5555f65e4bcce4a0f1fb3db18db79e37e04d

See more details on using hashes here.

File details

Details for the file tree_sitter_javadoc-0.2.4-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_javadoc-0.2.4-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 b565c4dad0181bdde9ee500d126dd4d9a9fcb517c9c9eb1280d1b7d50999ffd9
MD5 394a026f06590f28a63919d29c89f360
BLAKE2b-256 7c5611979d7c50fbca6b356ac8013684d90a3a92173638b60883e35d691fc2eb

See more details on using hashes here.

File details

Details for the file tree_sitter_javadoc-0.2.4-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_javadoc-0.2.4-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c8ab1a792a5b5d9e175dc042b0061f649f322666a1ecc5d5cb10850afcc3478f
MD5 0b748d3f5c719b351573681d2fe72a7d
BLAKE2b-256 86b7ee5c6a4ae4c6ca42041103dcff1cbc446c0ae7331e5cb50e4f0bf7483c4e

See more details on using hashes here.

File details

Details for the file tree_sitter_javadoc-0.2.4-cp310-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_javadoc-0.2.4-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 13652b68a8866a4b385fb817b4faa34ab6e1ce03f6448a0e8fcce8e306f50e57
MD5 15bbe9830e5739cb6edc45736bacf630
BLAKE2b-256 e0d009f9d338fe6837fccf20e7a65f8a0350d654c4d588a25c96d04b71a36cff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page