Add HACK and XXX
This commit is contained in:
parent
ed40c1f51f
commit
43cdfd792f
2 changed files with 14 additions and 9 deletions
|
|
@ -35,15 +35,13 @@ var oop = require("../lib/oop");
|
||||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||||
|
|
||||||
var DocCommentHighlightRules = function() {
|
var DocCommentHighlightRules = function() {
|
||||||
|
|
||||||
this.$rules = {
|
this.$rules = {
|
||||||
"start" : [ {
|
"start" : [ {
|
||||||
token : "comment.doc.tag",
|
token : "comment.doc.tag",
|
||||||
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
||||||
}, {
|
},
|
||||||
token : "comment.doc.tag",
|
DocCommentHighlightRules.getTagRule(),
|
||||||
regex : "\\b(?:TODO|FIXME)\\b"
|
{
|
||||||
}, {
|
|
||||||
defaultToken : "comment.doc",
|
defaultToken : "comment.doc",
|
||||||
caseInsensitive: true
|
caseInsensitive: true
|
||||||
}]
|
}]
|
||||||
|
|
@ -52,6 +50,13 @@ var DocCommentHighlightRules = function() {
|
||||||
|
|
||||||
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
||||||
|
|
||||||
|
DocCommentHighlightRules.getTagRule = function(start) {
|
||||||
|
return {
|
||||||
|
token : "comment.doc.tag.storage.type",
|
||||||
|
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
DocCommentHighlightRules.getStartRule = function(start) {
|
DocCommentHighlightRules.getStartRule = function(start) {
|
||||||
return {
|
return {
|
||||||
token : "comment.doc", // doc comment
|
token : "comment.doc", // doc comment
|
||||||
|
|
|
||||||
|
|
@ -302,22 +302,22 @@ var JavaScriptHighlightRules = function(options) {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"comment_regex_allowed" : [
|
"comment_regex_allowed" : [
|
||||||
{token : "storage.type", regex : "\\b(?:TODO|FIXME)\\b"},
|
DocCommentHighlightRules.getTagRule(),
|
||||||
{token : "comment", regex : "\\*\\/", next : "start"},
|
{token : "comment", regex : "\\*\\/", next : "start"},
|
||||||
{defaultToken : "comment", caseInsensitive: true}
|
{defaultToken : "comment", caseInsensitive: true}
|
||||||
],
|
],
|
||||||
"comment" : [
|
"comment" : [
|
||||||
{token : "storage.type", regex : "\\b(?:TODO|FIXME)\\b"},
|
DocCommentHighlightRules.getTagRule(),
|
||||||
{token : "comment", regex : "\\*\\/", next : "no_regex"},
|
{token : "comment", regex : "\\*\\/", next : "no_regex"},
|
||||||
{defaultToken : "comment", caseInsensitive: true}
|
{defaultToken : "comment", caseInsensitive: true}
|
||||||
],
|
],
|
||||||
"line_comment_regex_allowed" : [
|
"line_comment_regex_allowed" : [
|
||||||
{token : "storage.type", regex : "\\b(?:TODO|FIXME)\\b"},
|
DocCommentHighlightRules.getTagRule(),
|
||||||
{token : "comment", regex : "$|^", next : "start"},
|
{token : "comment", regex : "$|^", next : "start"},
|
||||||
{defaultToken : "comment", caseInsensitive: true}
|
{defaultToken : "comment", caseInsensitive: true}
|
||||||
],
|
],
|
||||||
"line_comment" : [
|
"line_comment" : [
|
||||||
{token : "storage.type", regex : "\\b(?:TODO|FIXME)\\b"},
|
DocCommentHighlightRules.getTagRule(),
|
||||||
{token : "comment", regex : "$|^", next : "no_regex"},
|
{token : "comment", regex : "$|^", next : "no_regex"},
|
||||||
{defaultToken : "comment", caseInsensitive: true}
|
{defaultToken : "comment", caseInsensitive: true}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue