cache modifier
This commit is contained in:
parent
961f8c4893
commit
1027dcea7c
1 changed files with 20 additions and 16 deletions
|
|
@ -218,10 +218,12 @@ var SqlServerHighlightRules = function() {
|
||||||
builtinFunctions = builtinFunctions.split('|');
|
builtinFunctions = builtinFunctions.split('|');
|
||||||
dataTypes = dataTypes.split('|');
|
dataTypes = dataTypes.split('|');
|
||||||
|
|
||||||
|
var modCache = {};
|
||||||
this.completionModifier = function(obj) {
|
this.completionModifier = function(obj) {
|
||||||
var word = obj.name,
|
var word = obj.name,
|
||||||
meta = 'keyword';
|
meta = 'keyword';
|
||||||
|
|
||||||
|
if (modCache[word] === undefined) {
|
||||||
if (builtInStoredProcedures.indexOf(word) !== -1) meta = "storedProcedure";
|
if (builtInStoredProcedures.indexOf(word) !== -1) meta = "storedProcedure";
|
||||||
else {
|
else {
|
||||||
//all others are upper case
|
//all others are upper case
|
||||||
|
|
@ -231,13 +233,15 @@ var SqlServerHighlightRules = function() {
|
||||||
else if (setStatements.indexOf(word) !== -1) meta = "setStatement";
|
else if (setStatements.indexOf(word) !== -1) meta = "setStatement";
|
||||||
else if (logicalOperators.indexOf(word) !== -1) meta = "logicalOperator";
|
else if (logicalOperators.indexOf(word) !== -1) meta = "logicalOperator";
|
||||||
}
|
}
|
||||||
|
modCache[word] = {
|
||||||
return {
|
word: word,
|
||||||
name: word,
|
|
||||||
value: word,
|
value: word,
|
||||||
score: 0,
|
meta: meta,
|
||||||
meta: meta
|
score: 0
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return modCache[word];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue