summaryrefslogtreecommitdiff
path: root/js/codeq
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2015-11-17 17:40:44 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2015-11-17 17:40:44 +0100
commit21b4977a5e0200aa14343112f1b7b03714f9385e (patch)
tree809e62866e0e9616145c0a1897cad93fcafc23b3 /js/codeq
parent64778c1479a565b85cdff1d8cc5dce4a72fac600 (diff)
Support different highlight colors for popup hints
Diffstat (limited to 'js/codeq')
-rw-r--r--js/codeq/hint.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/js/codeq/hint.js b/js/codeq/hint.js
index b5468e0..5db9fca 100644
--- a/js/codeq/hint.js
+++ b/js/codeq/hint.js
@@ -38,11 +38,11 @@
hintCounter = 0;
},
- addMark = function (start, end) {
+ addMark = function (start, end, style) {
var posStart = editor.posFromIndex(start),
posEnd = editor.posFromIndex(end),
doc = editor.getDoc(),
- mark = doc.markText(posStart, posEnd, {'className': 'editor-mark _emark_' + hintCounter}),
+ mark = doc.markText(posStart, posEnd, {'className': 'editor-mark _emark_' + hintCounter + ' ' + style}),
result = {'start': posStart, 'end': posEnd, 'mark': mark, 'className': '_emark_' + hintCounter};
hintCleaners.push(function () { mark.clear(); mark = null; doc = null; result.mark = null; });
hintCounter++;
@@ -255,7 +255,8 @@
'popup': function (type, template, serverHint) {
codeq.log.debug('Processing popup hint');
var args = serverHint.args,
- mark = addMark(serverHint.start, serverHint.end), // add the mark
+ style = serverHint.style || '',
+ mark = addMark(serverHint.start, serverHint.end, style), // add the mark
langs = codeq.availableLangs,
translations = {},
lang, i, content, htmlPrefix, instFunc;