(el, codeLanguage)
| 36 | // These ACEs are used for displaying code snippets statically, like in SpellPaletteEntryView popovers |
| 37 | // and have short lifespans |
| 38 | const initializeACE = function (el, codeLanguage) { |
| 39 | const contents = $(el).text().trim() |
| 40 | const editor = ace.edit(el) |
| 41 | editor.setOptions({ maxLines: Infinity }) |
| 42 | editor.setReadOnly(true) |
| 43 | editor.setTheme('ace/theme/textmate') |
| 44 | editor.setShowPrintMargin(false) |
| 45 | editor.setShowFoldWidgets(false) |
| 46 | editor.setHighlightActiveLine(false) |
| 47 | editor.setHighlightActiveLine(false) |
| 48 | editor.setBehavioursEnabled(false) |
| 49 | editor.renderer.setShowGutter(false) |
| 50 | editor.setValue(contents) |
| 51 | editor.clearSelection() |
| 52 | const session = editor.getSession() |
| 53 | session.setUseWorker(false) |
| 54 | session.setMode(aceEditModes[codeLanguage]) |
| 55 | session.setWrapLimitRange(null) |
| 56 | session.setUseWrapMode(true) |
| 57 | session.setNewLineMode('unix') |
| 58 | return editor |
| 59 | } |
| 60 | |
| 61 | const identifierRegex = function (lang, type) { |
| 62 | if (type === 'function') { |
nothing calls this directly
no test coverage detected