gedit highlighting class in js

Bug #1257406 reported by Michal Grňo
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gtksourceview2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

According to this post, the word class can be used as an object property name in JavaScript:
stackoverflow.com/questions/7022397/

But in Gedit, the class keyword is red everywhere in the document. That's quite annoying.

class = "xyz"; //This is wrong, is highlighted
foo.class = "xyz"; //This is right but is also highlighted

Would you fix it, please?

Revision history for this message
Michal Grňo (michal-grno) wrote :

Attaching a screenshot.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gtksourceview2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Mike Chelen (mchelen) wrote :

Workaround is to edit javascript.lang for example in Ubuntu 13.04:

/usr/share/gtksourceview-2.0/language-specs/javascript.lang

Comment out the "class" keyword in the "future-words" section:
    <context id="future-words" style-ref="future-words">
      <!-- <keyword>class</keyword> -->

This issue comes up when working with jQuery, for example:
$div = $('<div>', {class:'foo'});

Same problem also occurs in gtksourceview3

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.