webapp.cucumber.js.gherkin-editor.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ch.sbb.polarion.extension.cucumber Show documentation
Show all versions of ch.sbb.polarion.extension.cucumber Show documentation
It provides the almost same functionality as Xray plugin for Jira.
The newest version!
import CodeEditor from './petrel/CodeEditor.js'
import GherkinAutoComplete from './petrel/GherkinAutoComplete.js'
import hljs from './highlight/core.min.js'
import gherkin from './highlight/gherkin.js'
hljs.registerLanguage('gherkin', gherkin);
const content = document.getElementById('cucumberFeatureCodeEditorOriginalContent').innerText;
const element = document.getElementById('cucumberFeatureCodeEditor');
const codeEditor = new CodeEditor(element, {
readonly: true,
tabSize: 4
});
codeEditor.setHighlighter(code => hljs.highlight(code, {language: 'gherkin', ignoreIllegals: true}).value);
codeEditor.setAutoCompleteHandler(new GherkinAutoComplete());
codeEditor.setValue(content);
codeEditor.create();
// make it global
globalThis.cucumberFeatureCodeEditor = codeEditor;