MCPcopy Create free account
hub / github.com/codecombat/codecombat / initializeACE

Function initializeACE

app/core/aceUtils.js:38–59  ·  view source on GitHub ↗
(el, codeLanguage)

Source from the content-addressed store, hash-verified

36// These ACEs are used for displaying code snippets statically, like in SpellPaletteEntryView popovers
37// and have short lifespans
38const 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
61const identifierRegex = function (lang, type) {
62 if (type === 'function') {

Callers

nothing calls this directly

Calls 1

clearSelectionMethod · 0.80

Tested by

no test coverage detected