added SQL data types
This commit is contained in:
parent
fb7b23e627
commit
38e3452313
1 changed files with 14 additions and 6 deletions
|
|
@ -38,23 +38,28 @@ var SqlHighlightRules = function() {
|
||||||
|
|
||||||
var keywords = (
|
var keywords = (
|
||||||
"select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|" +
|
"select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|" +
|
||||||
"when|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary key|if|not|" +
|
"when|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|" +
|
||||||
"foreign key|"
|
"foreign|not|references|default|null"
|
||||||
);
|
);
|
||||||
|
|
||||||
var builtinConstants = (
|
var builtinConstants = (
|
||||||
"true|false|null"
|
"true|false"
|
||||||
);
|
);
|
||||||
|
|
||||||
var builtinFunctions = (
|
var builtinFunctions = (
|
||||||
"count|min|max|avg|sum|rank|now|coalesce|int|numeric|decimal|date|boolean|varchar|char|bigint|" +
|
"count|min|max|avg|sum|rank|now|coalesce"
|
||||||
"float|double"
|
);
|
||||||
|
|
||||||
|
var dataTypes = (
|
||||||
|
"int|numeric|decimal|date|varchar|char|bigint|" +
|
||||||
|
"float|double|bit|binary|text|set|timestamp|money|real|number"
|
||||||
);
|
);
|
||||||
|
|
||||||
var keywordMapper = this.createKeywordMapper({
|
var keywordMapper = this.createKeywordMapper({
|
||||||
"support.function": builtinFunctions,
|
"support.function": builtinFunctions,
|
||||||
"keyword": keywords,
|
"keyword": keywords,
|
||||||
"constant.language": builtinConstants
|
"constant.language": builtinConstants,
|
||||||
|
"storage.type": dataTypes
|
||||||
}, "identifier", true);
|
}, "identifier", true);
|
||||||
|
|
||||||
this.$rules = {
|
this.$rules = {
|
||||||
|
|
@ -89,6 +94,9 @@ var SqlHighlightRules = function() {
|
||||||
}, {
|
}, {
|
||||||
token : "text",
|
token : "text",
|
||||||
regex : "\\s+"
|
regex : "\\s+"
|
||||||
|
}, {
|
||||||
|
token : "entity.name.function",
|
||||||
|
regex : "\\s+"
|
||||||
} ]
|
} ]
|
||||||
};
|
};
|
||||||
this.normalizeRules();
|
this.normalizeRules();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue