@krassowski/jupyterlab-lsp
Version:
Language Server Protocol integration for JupyterLab
21 lines • 802 B
JavaScript
import { expect } from 'chai';
export function extract_code(document, code) {
return document.extract_foreign_code({ value: code, ce_editor: null }, {
line: 0,
column: 0
});
}
export function get_the_only_pair(foreign_document_map) {
expect(foreign_document_map.size).to.equal(1);
let range = foreign_document_map.keys().next().value;
let { virtual_document } = foreign_document_map.get(range);
return { range, virtual_document };
}
export function get_the_only_virtual(foreign_document_map) {
let { virtual_document } = get_the_only_pair(foreign_document_map);
return virtual_document;
}
export function wrap_in_python_lines(line) {
return 'print("some code before")\n' + line + '\n' + 'print("and after")\n';
}
//# sourceMappingURL=testutils.js.map