Finish Kiss-VScode overhaul first pass
This commit is contained in:
@@ -299,3 +299,6 @@
|
||||
|
||||
(function :Void osOpenFileInDir [&opt :String dir]
|
||||
(chooseFileInDir osOpenFile false dir))
|
||||
|
||||
(function :Void printThroughInfoMessage []
|
||||
(set Prelude.printStr ->s (infoMessage s)))
|
||||
Binary file not shown.
@@ -51,8 +51,8 @@
|
||||
},
|
||||
{
|
||||
"command": "kiss.insertUTestCase",
|
||||
"mac": "Cmd+; Cmd+u",
|
||||
"key": "Ctrl+; Ctrl+u"
|
||||
"mac": "Cmd+; Cmd+t Cmd+c",
|
||||
"key": "Ctrl+; Ctrl+t Ctrl+c"
|
||||
},
|
||||
{
|
||||
"command": "kiss.mapLinesSync",
|
||||
@@ -63,6 +63,16 @@
|
||||
"command": "kiss.sortLinesSync",
|
||||
"mac": "Cmd+; Cmd+l Cmd+s",
|
||||
"key": "Ctrl+; Ctrl+l Ctrl+s"
|
||||
},
|
||||
{
|
||||
"command": "kiss.updateExtension",
|
||||
"mac": "Cmd+; Cmd+u",
|
||||
"key": "Ctrl+; Ctrl+u"
|
||||
},
|
||||
{
|
||||
"command": "kiss.testAndUpdateExtension",
|
||||
"mac": "Cmd+; Cmd+t Cmd+u",
|
||||
"key": "Ctrl+; Ctrl+t Ctrl+u"
|
||||
}
|
||||
],
|
||||
"commands": [
|
||||
@@ -89,6 +99,14 @@
|
||||
{
|
||||
"title": "Kiss-Vscode: Sort the selected text lines using a (String,String)->Int comparator function",
|
||||
"command": "kiss.sortLinesSync"
|
||||
},
|
||||
{
|
||||
"title": "Kiss-Vscode: Update and reinstall the Kiss-Vscode extension you are editing",
|
||||
"command": "kiss.updateExtension"
|
||||
},
|
||||
{
|
||||
"title": "Kiss-Vscode: Check test.sh, then update and reinstall the kiss-vscode extension you are editing",
|
||||
"command": "kiss.testAndUpdateExtension"
|
||||
}
|
||||
],
|
||||
"languages": [
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
(loadFrom "kiss-vscode-api" "src/KissUtil.kiss")
|
||||
|
||||
(function _activate [:ExtensionContext context]
|
||||
(printThroughInfoMessage)
|
||||
(load "commands/ExtensionTools.kiss")
|
||||
(load "commands/KissTools.kiss")
|
||||
(load "commands/Lines.kiss"))
|
||||
@@ -1,7 +1,7 @@
|
||||
(loadFrom "kiss-vscode-api" "src/Util.kiss")
|
||||
|
||||
(function kvLibpath [] (.trim (assertProcess "haxelib" ["libpath" "kiss-vscode"])))
|
||||
(function :ChildProcessSpawnSyncOptions options [] (object cwd (let [path (kvLibpath)] (path.substr 0 (- path.length 1)))))
|
||||
(function extensionPath [] .fsPath .uri (first Vscode.workspace.workspaceFolders))
|
||||
(function :ChildProcessSpawnSyncOptions options [] (object cwd (extensionPath)))
|
||||
|
||||
(function handleUpdateFailure [error]
|
||||
(showCompileError "Error updating Kiss-VSCode: $error")
|
||||
@@ -14,25 +14,20 @@
|
||||
(return)
|
||||
})
|
||||
|
||||
(function :Void updateKissVscode [&opt _]
|
||||
(trySpawnSync "haxe" ["build.hxml"] (options) forceUpdateFailure)
|
||||
(defCommand context kiss.updateExtension "Update and reinstall the Kiss-Vscode extension you are editing" "C-; C-u" []
|
||||
(if (= "Windows" (Sys.systemName))
|
||||
{
|
||||
(trySpawnSync "cmd.exe" ["/c" "npm" "install"] (options) forceUpdateFailure)
|
||||
(trySpawnSync "cmd.exe" ["/c" "vsce" "package"] (options) forceUpdateFailure)
|
||||
}
|
||||
{
|
||||
(trySpawnSync "npm" ["install"] (options) forceUpdateFailure)
|
||||
(trySpawnSync "vsce" ["package"] (options) forceUpdateFailure)
|
||||
})
|
||||
(trySpawnSync "npm" ["install"] (options) forceUpdateFailure))
|
||||
(trySpawnSync "haxe" ["build.hxml"] (options) forceUpdateFailure)
|
||||
(awaitLet [_ (executeCommand
|
||||
"workbench.extensions.command.installFromVSIX"
|
||||
(Uri.file (joinPath (kvLibpath) (last (filter (FileSystem.readDirectory (kvLibpath)) ->file (file.endsWith ".vsix"))))))]
|
||||
(Uri.file (joinPath (extensionPath) (last (filter (FileSystem.readDirectory (extensionPath)) ->file (file.endsWith ".vsix"))))))]
|
||||
(catch [error]
|
||||
(handleUpdateFailure error)))
|
||||
|
||||
{})
|
||||
{}
|
||||
null)
|
||||
|
||||
(function testAndUpdateKissVscode [&opt _]
|
||||
(defCommand context kiss.testAndUpdateExtension "Check test.sh, then update and reinstall the kiss-vscode extension you are editing" "C-; C-t C-u" []
|
||||
(trySpawnSync "test.sh" [] (options) handleUpdateFailure)
|
||||
(updateKissVscode))
|
||||
(kiss_updateExtension))
|
||||
@@ -55,7 +55,7 @@ class ${className} {}
|
||||
(defCommand context kiss.showCorrespondingFile "Open the corresponding .kiss/.hx file to this one" "C-; C-f" []
|
||||
(showTextDocument (Uri.file (correspondingFile .fileName .document activeTextEditor))))
|
||||
|
||||
(defCommand context kiss.insertUTestCase "Generate a UTest test case in this .hx/.kiss file" "C-; C-u" []
|
||||
(defCommand context kiss.insertUTestCase "Generate a UTest test case in this .hx/.kiss file" "C-; C-t C-c" []
|
||||
(awaitLet [testName (inputBox)
|
||||
&sync testName
|
||||
"$(.toUpperCase (testName.substr 0 1))$(testName.substr 1)"
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Run the build without -D test first, to make sure it works that way too:
|
||||
echo "!test" && haxe build.hxml && echo "test" && haxe -D test build.hxml -cmd "node bin/extension.js"
|
||||
haxe build.hxml
|
||||
Reference in New Issue
Block a user