Bug 318465 - Opening PHP files causes errors and syntax highlighting fails
Summary: Opening PHP files causes errors and syntax highlighting fails
Status: VERIFIED FIXED
Alias: None
Product: kate
Classification: Applications
Component: syntax (show other bugs)
Version: Git
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-16 20:46 UTC by Gerald Senarclens de Grancy
Modified: 2013-05-24 08:30 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
1 - error (20.74 KB, image/png)
2013-04-16 20:46 UTC, Gerald Senarclens de Grancy
Details
2 - warning about missing highlighting (33.44 KB, image/png)
2013-04-16 20:47 UTC, Gerald Senarclens de Grancy
Details
Deleted Modelines/PHP includes (711 bytes, patch)
2013-05-24 08:23 UTC, xOneca
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Senarclens de Grancy 2013-04-16 20:46:26 UTC
Opening an existing php file w/
./run.sh kate ~/index.php
causes two errors:
1. Error - Kate | Unable to open
2. Information - Kate | Since there has been an error parsing the highlighting description, this highlighting will be disabled

Reproducible: Always

Steps to Reproduce:
1. using kate from git (pulled 20130416, evening), open an existing php file

Actual Results:  
errors as outlined above

Expected Results:  
file opens without errors and working syntax highlighting
Comment 1 Gerald Senarclens de Grancy 2013-04-16 20:46:53 UTC
Created attachment 78968 [details]
1 - error
Comment 2 Gerald Senarclens de Grancy 2013-04-16 20:47:31 UTC
Created attachment 78969 [details]
2 - warning about missing highlighting
Comment 3 Dominik Haumann 2013-04-17 11:13:13 UTC
Git commit 103ef498db27fd38ed8a145be197be7ba584f649 by Dominik Haumann.
Committed on 17/04/2013 at 13:12.
Pushed by dhaumann into branch 'master'.

unbreak PHP highlighting

The php files are auto-generated and there seems to be some magic
about IncludeRules here. Modelines needs to be excluded here.

This issue appeared two weeks ago and is in no public release.

You may need to remove build/part/syntax/data/*.xml in order to
regenerate the xml files. Otherwise, the old ones and the bug
just persists.

CCMAIL: i.zaufi@gmail.com

M  +1    -1    part/syntax/data/generate-php.pl

http://commits.kde.org/kate/103ef498db27fd38ed8a145be197be7ba584f649
Comment 4 ty.reed 2013-04-17 11:22:05 UTC
After updating highlighting files my php-html files fail at load with same error.
I fortunatly just upgraded hdd and still have ~/.kde4/katepart directory that I was able to copy KDE 4.8.5 files from.
Works with older version of syntax-highlighter files.
Configur Kate, again says same files need updating, but I'm not going to!

I will upload the kde 4.8.5 highlight files to : landisreed.com/files/syntax.tar.gz if anyone needs them.

Reed.
Comment 5 Dominik Haumann 2013-04-17 11:32:40 UTC
You need to regenerate the xml files and the make install again, assuming you follow http://kate-editor.org/get-it/
Regenerating the files implies that you remove them from your build directory...
Comment 6 ty.reed 2013-04-17 23:15:58 UTC
(In reply to comment #5)
> You need to regenerate the xml files and the make install again, assuming
> you follow http://kate-editor.org/get-it/
> Regenerating the files implies that you remove them from your build
> directory...

thank you.
Comment 7 Dávid Andor 2013-04-22 21:59:15 UTC
I have same problem.

kate(6782)/Kate (XML/Syntax) KateHighlighting::makeContextList: Unknown highlighting description referenced: "Modelines/PHP" in "/home/andor/.kde4/share/apps/katepart/syntax/html-php.xml"

openSUSE 12.3
KDE 4.10.2
Comment 8 Dominik Haumann 2013-04-23 13:55:17 UTC
Dávid: Did you use the Download dialog to get new syntax files?

The fix is to delete /home/andor/.kde4/share/apps/katepart/syntax/html-php.xml
There is no other way.
Comment 9 Dávid Andor 2013-04-23 21:19:10 UTC
Dominik: Thank you for the tipp.
I did already clean up twice my "~/.kde4/share/apps/katepart/syntax" directory without any result.
Now I delete again every *.xml file from "~/.kde4/share/apps/katepart/syntax" directory, and I update the syntax files with KATE built in download manager, and the following XML files does not get downloaded php.xml, html-php.xml.

So now I can open again the PHP files with syntax highlighting.

Syntax definitions in "/usr/share/kde4/apps/katepart/syntax" directory
language name="PHP (HTML)" version="1.99"
language name="PHP/PHP" version="1.42"
Comment 10 Teo Dumski 2013-05-03 19:51:07 UTC
Hi all,
I think this file causes the issue ~/.kde/share/apps/katepart/syntax/javascript-php.xml. After deleting it everything is OK.

System: Linux Mint 14 (nadia)
Kate version: 3.9.5

Hope it helps,
teo
Comment 11 Nicki Faulk 2013-05-09 12:28:51 UTC
Is there no way to duplicate the existing php.xml and adapt to become html-php.xml?  I tried a simply copy and rename, but obviously that doesn't work.
Comment 12 Nicki Faulk 2013-05-09 12:48:07 UTC
(In reply to comment #11)
> Is there no way to duplicate the existing php.xml and adapt to become
> html-php.xml?  I tried a simply copy and rename, but obviously that doesn't
> work.

Addendum: tried copying php.xml as html-php.xml and edited the language name= bit to say "PHP (HTML)" but that did not work as well.  Seeing that html-php.xml is vastly different than php.xml, I can't figure out what is breaking it.

Is there any way to force Kate to use php.xml syntax highlighting when opening PHP files?
Comment 13 Brian DeRocher 2013-05-09 16:52:36 UTC
I can confirm Teo's suggestion in comment #10.
Comment 14 Nicki Faulk 2013-05-09 17:13:27 UTC
(In reply to comment #13)
> I can confirm Teo's suggestion in comment #10.

I tried deleting that one as well.  I am still unable to open a php file and have the syntax highlighted. :(
Comment 15 Dávid Andor 2013-05-10 08:04:41 UTC
Yes. I can confirm too: The suggesion in comment #10 solve the problem.
Comment 16 xOneca 2013-05-24 08:23:03 UTC
Created attachment 80051 [details]
Deleted Modelines/PHP includes

Yes, comment #7 was right. I had syntax version 1.18, updated to 1.21 and broke all. A quick diff shows a Modelines/PHP syntax file included, but it doesn't exist.

Deleted the corresponding `<Include/>` lines and it worked!
Comment 17 xOneca 2013-05-24 08:30:52 UTC
Oops! I was so frustrated by the bug, I didn't see it was already fixed... :P

But no need to delete all custom syntax files. Only you have to do is remove a couple of <Include/> lines of the file `javascript-php.xml` (or the full file if you prefer).

The bug seems to be between the version 1.19 and 1.21. I think it will be fixed by 1.22...