Summary: | Feature request: kate seems to be missing a non-strict JSON highlighting that shows less false positive errors | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-syntax-highlighting | Reporter: | Ellie <el> |
Component: | syntax | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | andrea.ippo, jonathan.poelen, walter.von.entferndt |
Priority: | NOR | ||
Version First Reported In: | 5.114.0 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/frameworks/syntax-highlighting/-/commit/529a39f6cf8bb59b53749c6e4987e6ce52d860ed | Version Fixed In: | |
Sentry Crash Report: |
Description
Ellie
2024-02-08 01:36:49 UTC
As far as I could see, at least as of version 24.02.0, the tool to "JSON Format Full File" is simply jq. I'm checking if there's a way to let jq be more lenient, but if it exists, you can just pass whatever options to jq that achieves that result. Or, you could change executable entirely, and use an external program you have installed which does the job. Go to Settings, search for "External tools", then select "JSON Format Full File" and click on the Edit button below. I think it makes sense to both have a strict variant and a non-strict variant, since many users probably rely on both, as separate syntax options available at the same time. Given how many "JSON with comments" files are out there, my personal suggestion is that defaulting to the non-strict one would make more sense, but I understand many people disagree here. I hope this comment provides some insight on ideas for future plans. At present, json is not totally strict: trailing comma are not displayed in error, nor is the absence of comma between array and object (which makes it possible to support jsonline). A non-strict variant already exists: javascript. It can be configured for json files in Settings -> Open/Save -> Modes & FileTypes. It does less checking of {}/[] matches, and there's no color distinction, but it should support all extensions. We'll see about a non-strict variant and whether it should be the default. A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/719 Git commit 99b75731857cc7c940e1c60c4a204740cdb9cdd9 by Christoph Cullmann, on behalf of Jonathan Poelen. Committed on 16/07/2025 at 06:23. Pushed by cullmann into branch 'master'. add JSONC (JSON with Comments) highlighting Although not recommended, the .json extension is used instead of .jsonc. As a result, JSONC has a higher priority than JSON. A +35 -0 autotests/folding/test.jsonc.fold A +42 -0 autotests/html/test.jsonc.dark.html A +42 -0 autotests/html/test.jsonc.html A +35 -0 autotests/input/test.jsonc A +35 -0 autotests/reference/test.jsonc.ref M +3 -0 data/CMakeLists.txt A +50 -0 data/generators/generate-jsonc.pl M +10 -1 data/syntax/json.xml https://invent.kde.org/frameworks/syntax-highlighting/-/commit/99b75731857cc7c940e1c60c4a204740cdb9cdd9 Git commit 529a39f6cf8bb59b53749c6e4987e6ce52d860ed by Christoph Cullmann, on behalf of Jonathan Poelen. Committed on 16/07/2025 at 06:23. Pushed by cullmann into branch 'master'. add JSON5 highlighting A +50 -0 autotests/folding/test.json5.fold A +57 -0 autotests/html/test.json5.dark.html A +57 -0 autotests/html/test.json5.html A +50 -0 autotests/input/test.json5 A +50 -0 autotests/reference/test.json5.ref A +177 -0 data/syntax/json5.xml https://invent.kde.org/frameworks/syntax-highlighting/-/commit/529a39f6cf8bb59b53749c6e4987e6ce52d860ed I'm excited to see this addressed, thank you for your work! :-) |