Summary: | syntax highliting for .spec files: implement the yellow vertical bar on the left - for %if directives | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | urwald <urwald> |
Component: | syntax | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | CLOSED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Experimental support for %if... and section headers
rpmspec.xml template.spec kdevelop3.spec |
Description
urwald
2009-01-01 17:05:57 UTC
It would also be usefull to highlight the beginn of sections (%description, %prep, %build, %install, %clean, %files, %changelog) more. Actually these words are just painted in red color, just like everything else that starts with %. But as they have a special function (=starting a new section in the spec file), they could be highlighted much more. I don't think it would be very difficult to implemnt your ideas, and AFAICS they are good! Did you look insde the xml file: $(kde-config --path data)/katepart/syntax/rpmspec.xml ? It is not extremely difficult to understand! Yes, I've looked into this file. However I didn't understand it really good. Is there any documentation available for the file format? There is documentation in the maual, and at http://www.kate-editor.org. http://www.kate-editor.org/article/writing_a_kate_highlighting_xml_file The relevant manual chapter is here: http://docs.kde.org/kde3/en/kdebase/kate/katehighlight-xml-format.html Created attachment 29836 [details]
Experimental support for %if... and section headers
I have no good test spec file and I don't know enough about the syntax, so please try this and give feedback. If it is okay, I'll commit it
Created attachment 29862 [details]
rpmspec.xml
Okay, I've tried it - it's working.
But finally, I've spend some hours and made a new XML description for .spec files from scratch. While not perfect, it's IMHO much better than the previous one - highlighting is much more exact and fits better the meaning in the .spec file. Folding blocks are not supported for sections, but implemented only for %if/%endif blocks (because %if blocks can span over several (parts of) sections - it would not work fine to support folding blocks for both.) I'll attach test files for trying out the XML description...
Created attachment 29863 [details]
template.spec
example .spec file, showing some features of the new XML description
Created attachment 29864 [details]
kdevelop3.spec
A (quite big and complex) real word example from openSUSE build service
SVN commit 905702 by jowenn: New RPM Spec file highlighting and two testcases, created / uploaded by Tim Fechtner as attachments to bug 179295. BUG: 179295 M +129 -60 syntax/data/rpmspec.xml A tests/highlight.spec A tests/highlight1.spec WebSVN link: http://websvn.kde.org/?view=rev&revision=905702 Verified in 4.2 RC. |