On Fri, Sep 28, 2012 at 7:35 AM, Eddy B. <[email protected]> wrote: > Hi all,
Hi Eddy, > I'm sorry I didn't reply to this sooner, I didn't recognize that commit hash > as being related to my patch - https://git.reviewboard.kde.org/r/106540/ > I just tested this, and it seems a missing closing brace or a missing > double-colon in a conditional expression cause the Javascript rules to never > exit to its main context (which is fine you're highlighting just JS, but > break HTML's </script>). > About PHP, I thought javascript-php.xml was used there, which I haven't > touched. > > As an explanation for why that happens: to properly detect if "identifier:" > should be highlighted normally (which only makes sense in conditional > expressions) instead of an object label, a context has to be entered for the > conditional expression. > However, you can have "a?{b:c}:d", in which case "b:" should be highlighted > as an object label. That means you also need to enter a context for the > object literal - in my "a?{b:c}:d" example, that would be > Normal->ConditionalExpr->Object. > The context stacking can continue, and any missing double-colons (to exit > ConditionalExpr) or closing braces (to exit Object), will leave extra > contexts at the end of the JS code, disabling HTML's check for "</script>". > > I have to point out that while it can be annoying, it shouldn't happen > unless you have a syntax error in your JS. > And I don't see a better way to choose how to highlight "identifier:" - I > hope you do, otherwise it will be hard to fix this problem nicely. Unfortunately in this case, the php files I am opening (to test this with) are extremely basic, with only a couple of lines of php code. There is certainly nothing that looks like a html or javascript tag. The error it causes seems to be related to the filename(s) of other highlighting files, as it gives a "Cannot open" message box first, followed by a notice that highlighting is being disabled. > > Thanks, Eddy. Regards, Ben > > 2012/9/27 Dominik Haumann <[email protected]> >> >> Hi Ben, >> >> sorry for not answering immediately. >> >> On Thursday, 27. September 2012 17:28:48 Ben Cooksley wrote: >> > Hi all, >> > >> > I will be reverting commit cd8a8d6d3914ce8a72f252b054073193b97dd0a7 in >> > kate in 24 hours unless a fix is provided. The issue it introduces, >> > especially with php files is particularly disruptive to user workflow. >> > (I don't understand exactly how a broken Javascript syntax file can >> > affect PHP though...) >> > >> > On my local system, reverting this commit allows highlighting of php >> > files to function once more, and also permits "make test" to complete >> > without intervention. This will also restore normal behaviour of tests >> > on build.kde.org when performing Kate builds. >> > >> > Regards, >> > Ben >> >> I quickly ran this one unit test and it worked for me, but I haven't >> investigated in more depth. The highlightings are included in other >> languages >> as well (e.g. from PHP you can get into JavaScript in the same file). >> >> Please revert, I'll look into this later then. >> >> Thanks, >> Dominik >> _______________________________________________ >> KWrite-Devel mailing list >> [email protected] >> https://mail.kde.org/mailman/listinfo/kwrite-devel > > _______________________________________________ Kde-buildsystem mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-buildsystem
