()
| 83 | const snippets = document.getElementById('snippets'); |
| 84 | |
| 85 | function updateSnippet() { |
| 86 | const selected = snippets.value; |
| 87 | |
| 88 | // the require here creates a webpack context; it's fine to use it |
| 89 | // dynamically. |
| 90 | // https://webpack.js.org/guides/dependency-management/ |
| 91 | const snippet = require(`../snippets/${selected}.py?raw`); |
| 92 | |
| 93 | editor.dispatch({ |
| 94 | changes: { from: 0, to: editor.state.doc.length, insert: snippet }, |
| 95 | }); |
| 96 | } |
| 97 | function updateSnippetAndRun() { |
| 98 | updateSnippet(); |
| 99 | requestAnimationFrame(runCodeFromTextarea); |
no outgoing calls
no test coverage detected