kiss-vscode insert, insertAt functions

This commit is contained in:
2021-02-17 09:56:40 -07:00
parent 9fac23bcd0
commit 7e4f3c269b

View File

@@ -28,6 +28,18 @@
(document.getText range))
""))
// TODO make an async annotation that throws an error if the promise is not wrapped in awaitLet or awaitBegin or returned by an async function?
// but in some cases it doesn't matter and there are so many edge cases.
(defun insertAt [:Position pos text]
(.edit activeTextEditor
(lambda [e]
(e.insert pos text))))
(defun insert [text]
// TODO this let is because identifier alias dot access is broken:
(let [editor activeTextEditor]
(insertAt editor.selection.active text)))
/**
* State
*/