https://bugs.kde.org/show_bug.cgi?id=432976
Bug ID: 432976
Summary: Kate lacks Zig syntax highlighting and detects .zig
files as C language, breaking LSP plugin
Product: kate
Version: 20.12.2
Platform: Archlinux Packages
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: syntax
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
SUMMARY
When I open a .zig file in Kate, it's detected as C language, causing the LSP
plugin to launch clangd instead of zls.
STEPS TO REPRODUCE
1. Launch Kate and open a .zig file.
2. Optionally enable the "LSP Client" plugin, and open the "LSP Client" tool
view and look at the Messages tab.
OBSERVED RESULT
Kate recognizes the Zig source code file as C. As a result, the LSP client
launches clangd (which fails to parse the file, and gives inaccurate
completions) instead of zls.
EXPECTED RESULT
Kate recognizes the Zig source file as Zig, applies Zig syntax highlighting,
and launches zls (which the LSP client is already configured to do).
I don't know if it's intentional that Kate doesn't offer Zig highlighting and
requires that you install it yourself. But it seems strange considering that
Kate's LSP plugin offers a built-in rule
(https://invent.kde.org/utilities/kate/-/merge_requests/117) to recognize Zig
highlighting and run zls, yet Kate doesn't have a built-in Zig highlighting
mode.
In the end, I installed https://github.com/ziglang/kde-syntax-highlighting
(last updated 2018), which required `mkdir -p
$HOME/.local/share/org.kde.syntax-highlighting/syntax/` since the folder didn't
exist yet. After switching previously opened files from C to Zig highlighting
mode, zls is called properly.
Operating System: Garuda Linux
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Kernel Version: 5.10.15-120-tkg-bmq
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-6200U CPU @ 2.30GHz
Memory: 7.6 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 520
ADDITIONAL INFORMATION
--
You are receiving this mail because:
You are watching all bug changes.