Rust supports nested block comments. So, a block comment doesn't end with the first "*/" sequence, but instead it counts how often "/*" had been before. [1] Kate however doesn't support this and assumes behaviour similar to C, which doesn't have nested block comments. As an example, take the code at [2], and copy it into kate, setting the format to "Rust". It won't highlight the first "main" function as comment, even though it should (and the format [2] even does). [1]: https://doc.rust-lang.org/reference.html#comments [2]: https://play.rust-lang.org/?gist=50645e9b3c25b92d59ed&version=stable I haven't checked the latest version of Kate, my version is 15.08.2 (KDE Frameworks 5.15.0), but from git log src/syntax/data/rust.xml I can see there hasn't been any change of the rust format file since may 2015, and the commit at the v5.15.0 tag is more recent.
Created attachment 96933 [details] Patch to fix the bug I've attached a patch with the fix.
Does this also require a bump of the xml's version? I'm not sure.
Git commit 366d4d5ce1b8aee62c2214304f1c165955ba3f0b by Eike Hein, on behalf of est 31. Committed on 07/03/2016 at 07:22. Pushed by hein into branch 'master'. Fix nested comment blocks. M +1 -0 src/syntax/data/rust.xml http://commits.kde.org/ktexteditor/366d4d5ce1b8aee62c2214304f1c165955ba3f0b