Created attachment 170067 [details] Adding and deleting an empty line to/from the end of a file in Kate to make the bug appear. SUMMARY Syntax highlighting breaks if last line is blank or contains only whitespace STEPS TO REPRODUCE 1. Open a file that's syntax highlighted 2. Scroll to the end 3. Add a new empty line if the last line is not blank OBSERVED RESULT Syntax highlighting breaks: functions, etc aren't colored anymore. (See attachment) EXPECTED RESULT Syntax highlighting works even if the last line of the file is empty SOFTWARE/OS VERSIONS Linux/KDE Plasma: Fedora Linux 40 (available in About System) KDE Plasma Version: 6.0.5 KDE Frameworks Version: 6.2.0 Qt Version: 6.7.1 ADDITIONAL INFORMATION Also reproduced on the latest git master branch (as of writing this)
Hmm, that is the semantic highlighting info the zig language server sends to us. Could that be a bug in that? We just send over the content. Naturally we might handle the response wrong.
(In reply to Christoph Cullmann from comment #1) > Hmm, that is the semantic highlighting info the zig language server sends to > us. > Could that be a bug in that? We just send over the content. > Naturally we might handle the response wrong. Don't know, but I can't reproduce this bug in other text editors such as Helix and VSCodium.
Debugged this a little bit, seems to be a server issue. When a range with last line == empty, the server sends over a response which highlights all the comments in the document for some reason?? Filed an issue https://github.com/zigtools/zls/issues/1974
Fixed on the server side, closing.