diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2017-02-26 19:46:18 +0100 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2017-02-26 19:46:18 +0100 |
commit | 73badd57906358fd0c238dc7764ae86c0ae42bdc (patch) | |
tree | e00513a5e461a95683482e02f1503ca41d93a579 /js/codeq | |
parent | bef26bc8114bcd9c368df0448eceaa739267819b (diff) |
Allow empty popup hints (highlight only)
Diffstat (limited to 'js/codeq')
-rw-r--r-- | js/codeq/hint.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/js/codeq/hint.js b/js/codeq/hint.js index e77a3dc..0242443 100644 --- a/js/codeq/hint.js +++ b/js/codeq/hint.js @@ -180,6 +180,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ typeHandlers = { 'static': function (template, hint, box) { + if (!template) return; var content = prepareStaticHintContent(template, hint.indices, hint.id), args = hint ? hint.args : null, hintIndex = 0, @@ -251,11 +252,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ codeq.log.debug('Processing popup hint'); var args = hint.args, style = hint.style || '', - mark = addMark(hint.start, hint.end, style), // add the mark langs = codeq.availableLangs, translations = {}, lang, i, content, htmlPrefix, instFunc; + // highlight given range in the editor + var mark = addMark(hint.start, hint.end, style); + if (!template) return; + // execute templates for all languages for (i = langs.length - 1; i >= 0; i--) { lang = langs[i]; @@ -337,10 +341,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ continue; } hintContent = hintProblemTr[hint.id] || hintCommonTr[hint.id]; - if (!hintContent) { - codeq.log.error('Hint without content: ' + hint.id); - continue; - } t = typeof hintDef; if (t === 'string') hintType = hintDef; // currently a hint type is a string |