Implement Kiss-VSCode in Kiss

This commit is contained in:
2021-01-17 14:02:35 -07:00
parent 70cb43c7f4
commit 5a669fc9ea
4 changed files with 31 additions and 3 deletions

View File

@@ -86,6 +86,8 @@ class Reader {
readTable[","] = (stream, k) -> Unquote(assertRead(stream, k));
readTable[",@"] = (stream, k) -> UnquoteList(assertRead(stream, k));
// TODO make {...} a macro for (begin ...)
// Because macro keys are sorted by length and peekChars(0) returns "", this will be used as the default reader macro:
readTable[""] = (stream, k) -> Symbol(nextToken(stream, "a symbol name"));

View File

@@ -1,5 +1,7 @@
-cp src
-lib vscode
-lib hxnodejs
-lib kiss
-js bin/extension.js
-D analyzer-optimize
-D js-es=6

View File

@@ -1,10 +1,15 @@
import vscode.*;
import Sys;
import sys.io.Process;
import kiss.Kiss;
import kiss.Prelude;
import haxe.io.Path;
@:build(kiss.Kiss.build("src/Main.kiss"))
class Main {
// TODO support EMeta(s:MetadataEntry, e:Expr) via Kiss
@:expose("activate")
static function activate(context:ExtensionContext) {
context.subscriptions.push(Vscode.commands.registerCommand("kiss.sayHello", function() {
Vscode.window.showInformationMessage("Hello from Haxe!");
}));
_activate(context);
}
}

View File

@@ -0,0 +1,19 @@
(defun userConfigDir []
(Path.join [
(or (Sys.getEnv "MSYSHOME") (Sys.getEnv "HOME") (Sys.getEnv "UserProfile"))
".kiss"]))
(defvar &mut activeConfigDir "")
// (defun tryLoadConfig [&opt selectedText]
// )
(defun _activate [:ExtensionContext context]
(set activeConfigDir (Path.join [context.extensionPath "config"]))
(print "yyooooo")
(context.subscriptions.push
(Vscode.commands.registerCommand
"kiss-vscode.sayHello"
(lambda []
(Vscode.window.showInformationMessage "Hello from Haxe!")))))