tokei
tokei copied to clipboard
Rust doc comments being miscounted
This rust code is being counted weirdly:
/* A */
/// B
struct C;
It results in the output
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
Rust 1 1 1 0 0
|- Markdown 1 1 0 1 0
(Total) 2 1 1 0
===============================================================================
Total 1 1 1 0 0
===============================================================================
- The file is 4 lines long (
wc -lagrees), yet the total reported by tokei is 1. - The total does not include any comments or blanks.
- The total disagrees with the total for the rust section.
If I add more empty lines between /* A */ and /// B, they are simply ignored.
If I change /// B to // B, the output is correct.
Similar things happen with this simplified two-liner example:
/// A
struct B;
Tokei output:
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
Rust 1 1 1 0 0
|- Markdown 1 1 0 1 0
(Total) 2 1 1 0
===============================================================================
Total 1 1 1 0 0
===============================================================================
Tested on commit fd08c8b889f96986d3a05a17c58998ca062e9176 (the current master) with a freshly cloned tokei.
Thank you for your issue! I'll have to investigate further, but you can see what's happening in tokei with tokei -vvv.
Block docstrings are not counted as markdown.
Source file:
/*!
Module docstring
*/
/**
Item docstring
*/
struct CoolStuff;
tokei output:
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
Rust 1 8 1 6 1
===============================================================================
Total 1 8 1 6 1
===============================================================================