Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getEntityFn = (custom && custom.getEntity) || currentSelection
let currentEntity = getEntityFn(tab)
const getEntity = () => currentEntity
// for certain content types, always show folding controls, rather
// than on mouse over (which is the default behavior for monaco)
const entityRightNow = currentEntity
const kind = entityRightNow && ((entityRightNow.exec && entityRightNow.exec.kind) || entityRightNow.contentType)
if (kind === 'yaml' || kind === 'json') {
options.showFoldingControls = 'always'
}
if (!pre2) {
injectCSS({
css: require('@kui-shell/plugin-editor/web/css/editor.css').toString(),
key: 'editor.editor'
})
pre2 = true
}
const content = document.createElement('div')
const editorWrapper = document.createElement('div')
editorWrapper.className = 'monaco-editor-wrapper'
content.appendChild(editorWrapper)
// we want the editor to have focus, so the user can start coding
// (but don't bother if we are in readOnly mode)
if (!options.readOnly) {
editorWrapper.focus()
}