[vscode] error message when evalString fails to compile kiss
This commit is contained in:
@@ -54,7 +54,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
(defun :String convertToHScript [kissStr]
|
(defun :String convertToHScript [kissStr]
|
||||||
(.toString (the Buffer .stdout (ChildProcess.spawnSync "haxelib" ["run" "kiss" "--all"] (object input kissStr)))))
|
(let [kissProcess (ChildProcess.spawnSync "haxelib" ["run" "kiss" "--all"] (object input kissStr))]
|
||||||
|
(if !(= kissProcess.status 0)
|
||||||
|
{(errorMessage "failed to compile ${kissStr}: $(.toString (the Buffer .stderr kissProcess))") ""}
|
||||||
|
(.toString (the Buffer .stdout kissProcess)))))
|
||||||
|
|
||||||
(defun :Dynamic evalString [:String kissStr]
|
(defun :Dynamic evalString [:String kissStr]
|
||||||
(try
|
(try
|
||||||
@@ -62,7 +65,6 @@
|
|||||||
(parser.parseString
|
(parser.parseString
|
||||||
(convertToHScript kissStr)))
|
(convertToHScript kissStr)))
|
||||||
(catch [e]
|
(catch [e]
|
||||||
(trace "fuckkkkk")
|
|
||||||
(errorMessage "Error `${e}` from $kissStr")
|
(errorMessage "Error `${e}` from $kissStr")
|
||||||
null)))
|
null)))
|
||||||
|
|
||||||
@@ -102,6 +104,10 @@
|
|||||||
(dictSet commands description command))
|
(dictSet commands description command))
|
||||||
|
|
||||||
(defun :Void registerBuiltins []
|
(defun :Void registerBuiltins []
|
||||||
|
(set Prelude.print
|
||||||
|
->[v] {
|
||||||
|
(infoMessage (Std.string v))
|
||||||
|
v})
|
||||||
(registerCommand "Rerun last command" runLastCommand)
|
(registerCommand "Rerun last command" runLastCommand)
|
||||||
(registerCommand "Run a keyboard shortcut command" runKeyboardShortcut)
|
(registerCommand "Run a keyboard shortcut command" runKeyboardShortcut)
|
||||||
(registerCommand "Evaluate and print a Kiss expression" evalAndPrint))
|
(registerCommand "Evaluate and print a Kiss expression" evalAndPrint))
|
||||||
|
Reference in New Issue
Block a user