Bug 241266 - Kate: incorrect Makefile syntax highlighting
Summary: Kate: incorrect Makefile syntax highlighting
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: syntax (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-10 06:20 UTC by Kevin
Modified: 2011-08-06 10:23 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
incorrect syntax highlighting makefile (6.13 KB, image/png)
2010-06-10 06:22 UTC, Kevin
Details
makefile.xml I am using (6.39 KB, application/xml)
2010-08-03 22:27 UTC, Matthew Woehlke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin 2010-06-10 06:20:07 UTC
Version:           unspecified (using KDE 4.4.3) 
OS:                Linux

Kate shows incorrect syntax highlighting in a Makefile.

Reproducible: Always

Steps to Reproduce:
Makefile below.

DIR = /bin
ROOT_FILES = $(shell for f in ${DIR}/*; do basename $$f; done)

Actual Results:  
Screen shot attached.

Expected Results:  
I expect more blue text.
Comment 1 Kevin 2010-06-10 06:22:19 UTC
Created attachment 47846 [details]
incorrect syntax highlighting makefile
Comment 2 Matthew Woehlke 2010-06-18 01:13:40 UTC
It looks fine for me (i.e. I get expected highlighting, not what is in your screenshot). Can you please grab the latest makefile.xml from svn and drop it in your user HL directory and see if you still have problems?

I get:
<var>ROOT_FILES</var> = <oper>$(</oper><var>shell</var> for f in <oper>${</oper><var>DIR</var><oper>}</oper>/*; do basename <special>$$</special>f; done<oper>)</oper>

(...where the markup represents coloration with the Variable, Operator and Special attributes; everything else is String.)

Also, while it looks like it probably is, double check that kate is actually using the makefile highlighter; Tools -> Highlighting -> Others -> Makefile.
Comment 3 Russell 2010-07-24 00:29:45 UTC
    kdebase4 => version 4.3.5
        kate => version 4.3.5
makefile.xml => version 1.10

I went to: Settings -> Configure Kate -> Open Save -> Modes & Filetypes -> Download Highlighting Files...

I have the current makefile.xml according to Kate settings.

I get the same highlighting as Kevin.  In addition, it seems comments on
lines that contain variable assignments are not recognized. They are the same color as the assigned value, rather than the "comment" color.

For example:

# This comment okay
DIR = /bin                                       # Not Okay
SHELL := /bin/sh                                 # Not Okay
.SUFFIXES :                                      # Okay
.SUFFIXES : .o .r .f .l                          # Okay

I went to:
http://websvn.kde.org/tags/KDE/4.4.95/kdelibs/kate/syntax/data/makefile.xml?view=log, and did a diff with the makefile.xml on my system, and they are the same.
Comment 4 Matthew Woehlke 2010-08-03 22:24:29 UTC
Hmm. Okay, it turns out I have a modified makefile.xml (that I forgot I had). I wonder if that means I fixed this already, locally, and forgot about it...
Comment 5 Matthew Woehlke 2010-08-03 22:27:27 UTC
Created attachment 49788 [details]
makefile.xml I am using

Here's what I'm using. I'll try to take another look at what this changes and possibly get it pushed upstream. I'd welcome help if someone else wants to do that; due to current Real Life circumstances, I might not get to it for a few weeks (and someone should nudge me in a week or so, or I might forget).

Meanwhile, feel free to play around with this and see if it helps.
Comment 6 Matthew Woehlke 2010-08-03 22:29:30 UTC
I should also add, the date on that is 2006-11-01, any changes since then probably should be merged.
Comment 7 Kevin 2011-02-01 06:20:33 UTC
this bug is still in KDE 4.6.0
Comment 8 Dominik Haumann 2011-08-01 13:44:30 UTC
Matthew: Can you have a look at whether the patch still applies?
Comment 9 Dominik Haumann 2011-08-03 10:02:34 UTC
Git commit 75f96977906b41dbf00695949eb382c4319bc2ee by Dominik Haumann.
Committed on 03/08/2011 at 12:01.
Pushed by dhaumann into branch 'master'.

fix {...) and (...} matching

BUG: 241266

M  +32   -16   part/syntax/data/makefile.xml

http://commits.kde.org/kate/75f96977906b41dbf00695949eb382c4319bc2ee
Comment 10 Dominik Haumann 2011-08-06 10:23:26 UTC
Git commit 224e1e0a45167f3c6b02457a4a4ee348c132083d by Dominik Haumann.
Committed on 03/08/2011 at 12:01.
Pushed by dhaumann into branch 'KDE/4.7'.

fix {...) and (...} matching

BUG: 241266

M  +32   -16   part/syntax/data/makefile.xml

http://commits.kde.org/kate/224e1e0a45167f3c6b02457a4a4ee348c132083d