move project folder to repo root
This commit is contained in:
3
projects/_standalone/kiss-vscode/.gitignore
vendored
3
projects/_standalone/kiss-vscode/.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
bin/
|
||||
*.vsix
|
||||
node_modules/
|
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"version": "4.3.1",
|
||||
"resolveLibs": "scoped"
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/*.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "hxml",
|
||||
"file": "build.hxml",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@@ -1,5 +0,0 @@
|
||||
.vscode
|
||||
bin/*.map
|
||||
src
|
||||
build.hxml
|
||||
test.sh
|
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"comments": {
|
||||
"lineComment": "//",
|
||||
"blockComment": [ "/*", "*/" ]
|
||||
},
|
||||
"brackets": [
|
||||
["(", ")"],
|
||||
["[", "]"]
|
||||
],
|
||||
"autoClosingPairs": [
|
||||
["(", ")"],
|
||||
["[", "]"],
|
||||
["\"", "\""],
|
||||
["{", "}"]
|
||||
],
|
||||
"surroundingPairs": [
|
||||
["(", ")"],
|
||||
["[", "]"],
|
||||
["\"", "\""],
|
||||
["{", "}"]
|
||||
]
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
# kiss-vscode README
|
||||
Experimental Kiss support for VSCode
|
||||
|
||||
## Features
|
||||
|
||||
* Syntax highlighting for .kiss files
|
||||
* Commands for editing kiss code
|
||||
|
||||
## Extension Settings
|
||||
|
||||
## Known Issues
|
||||
|
||||
## Release Notes
|
@@ -1,15 +0,0 @@
|
||||
-lib kiss-vscode-api
|
||||
-lib kiss
|
||||
-lib uuid
|
||||
-lib hscript
|
||||
-lib tink_macro
|
||||
-lib re-flex
|
||||
-lib kiss-tools
|
||||
-cp src
|
||||
-js bin/extension.js
|
||||
-dce full
|
||||
-D analyzer-optimize
|
||||
-D js-es=6
|
||||
-debug
|
||||
Main
|
||||
-cmd npx vsce package
|
@@ -1,5 +0,0 @@
|
||||
# @install: lix --silent download "haxelib:/haxe-strings#7.0.3" into haxe-strings/7.0.3/haxelib
|
||||
-cp ${HAXE_LIBCACHE}/haxe-strings/7.0.3/haxelib/src/
|
||||
-D haxe-strings=7.0.3
|
||||
--macro hx.strings.internal.Macros.addDefines()
|
||||
--macro hx.strings.internal.Macros.configureNullSafety()
|
@@ -1,5 +0,0 @@
|
||||
# @install: lix --silent download "haxelib:/hscript#2.5.0" into hscript/2.5.0/haxelib
|
||||
# @run: haxelib run-dir hscript "${HAXE_LIBCACHE}/hscript/2.5.0/haxelib"
|
||||
-cp ${HAXE_LIBCACHE}/hscript/2.5.0/haxelib/
|
||||
-D hscript=2.5.0
|
||||
--macro keep('IntIterator')
|
@@ -1,7 +0,0 @@
|
||||
# @install: lix --silent download "gh://github.com/haxefoundation/hxnodejs#504066dc1ba5ad543afa5f6c3ea019f06136a82b" into hxnodejs/12.1.0/github/504066dc1ba5ad543afa5f6c3ea019f06136a82b
|
||||
-cp ${HAXE_LIBCACHE}/hxnodejs/12.1.0/github/504066dc1ba5ad543afa5f6c3ea019f06136a82b/src
|
||||
-D hxnodejs=12.1.0
|
||||
--macro allowPackage('sys')
|
||||
# should behave like other target defines and not be defined in macro context
|
||||
--macro define('nodejs')
|
||||
--macro _internal.SuppressDeprecated.run()
|
@@ -1,4 +0,0 @@
|
||||
# @install: lix --silent download "gh://github.com/kiss-lang/kiss-tools#b0b90316ee5bda93f65c193e1d5898cbfea6b034" into kiss-tools/0.0.0/github/b0b90316ee5bda93f65c193e1d5898cbfea6b034
|
||||
-lib kiss
|
||||
-cp ${HAXE_LIBCACHE}/kiss-tools/0.0.0/github/b0b90316ee5bda93f65c193e1d5898cbfea6b034/src/
|
||||
-D kiss-tools=0.0.0
|
@@ -1,8 +0,0 @@
|
||||
# @install: lix --silent download "gh://github.com/kiss-lang/kiss-vscode-api#c6eaec798211f9b68cf71e686874ae0ce9c2ca88" into kiss-vscode-api/0.0.0/github/c6eaec798211f9b68cf71e686874ae0ce9c2ca88
|
||||
# @run: haxelib run-dir kiss-vscode-api "${HAXE_LIBCACHE}/kiss-vscode-api/0.0.0/github/c6eaec798211f9b68cf71e686874ae0ce9c2ca88"
|
||||
-lib hxnodejs
|
||||
-lib kiss
|
||||
-lib re-flex
|
||||
-lib vscode
|
||||
-cp ${HAXE_LIBCACHE}/kiss-vscode-api/0.0.0/github/c6eaec798211f9b68cf71e686874ae0ce9c2ca88/src/
|
||||
-D kiss-vscode-api=0.0.0
|
@@ -1,12 +0,0 @@
|
||||
# @install: lix --silent download "gh://github.com/kiss-lang/kiss#41c58fe7c724490a440a66faba21109a8aa34af7" into kiss/0.0.1/github/41c58fe7c724490a440a66faba21109a8aa34af7
|
||||
# @run: haxelib run-dir kiss "${HAXE_LIBCACHE}/kiss/0.0.1/github/41c58fe7c724490a440a66faba21109a8aa34af7"
|
||||
-lib haxe-strings
|
||||
-lib hscript
|
||||
-lib tink_json
|
||||
-lib tink_macro
|
||||
-lib tink_syntaxhub
|
||||
-lib uuid
|
||||
-cp ${HAXE_LIBCACHE}/kiss/0.0.1/github/41c58fe7c724490a440a66faba21109a8aa34af7/src
|
||||
-D kiss=0.0.1
|
||||
-w -WUnusedPattern
|
||||
--macro kiss.KissFrontend.use()
|
@@ -1,5 +0,0 @@
|
||||
# @install: lix --silent download "gh://github.com/kiss-lang/re-flex#af60a7f889511361c10f34b93679637ff43cfa09" into re-flex/0.0.0/github/af60a7f889511361c10f34b93679637ff43cfa09
|
||||
# @run: haxelib run-dir re-flex "${HAXE_LIBCACHE}/re-flex/0.0.0/github/af60a7f889511361c10f34b93679637ff43cfa09"
|
||||
-lib kiss
|
||||
-cp ${HAXE_LIBCACHE}/re-flex/0.0.0/github/af60a7f889511361c10f34b93679637ff43cfa09/src/
|
||||
-D re-flex=0.0.0
|
@@ -1,3 +0,0 @@
|
||||
# @install: lix --silent download "haxelib:/tink_core#2.1.0" into tink_core/2.1.0/haxelib
|
||||
-cp ${HAXE_LIBCACHE}/tink_core/2.1.0/haxelib/src
|
||||
-D tink_core=2.1.0
|
@@ -1,4 +0,0 @@
|
||||
# @install: lix --silent download "haxelib:/tink_json#0.11.0" into tink_json/0.11.0/haxelib
|
||||
-lib tink_typecrawler
|
||||
-cp ${HAXE_LIBCACHE}/tink_json/0.11.0/haxelib/src
|
||||
-D tink_json=0.11.0
|
@@ -1,4 +0,0 @@
|
||||
# @install: lix --silent download "haxelib:/tink_macro#1.0.1" into tink_macro/1.0.1/haxelib
|
||||
-lib tink_core
|
||||
-cp ${HAXE_LIBCACHE}/tink_macro/1.0.1/haxelib/src
|
||||
-D tink_macro=1.0.1
|
@@ -1,3 +0,0 @@
|
||||
-D tink_priority=0.1.3
|
||||
# @install: lix --silent download "gh://github.com/haxetink/tink_priority#ea736d31dc788aae703a2aa415c25d5b80d0e7d1" into tink_priority/0.1.3/github/ea736d31dc788aae703a2aa415c25d5b80d0e7d1
|
||||
-cp ${HAXE_LIBCACHE}/tink_priority/0.1.3/github/ea736d31dc788aae703a2aa415c25d5b80d0e7d1/src
|
@@ -1,6 +0,0 @@
|
||||
# @install: lix --silent download "gh://github.com/haxetink/tink_syntaxhub#b6ea4966bbdee4d176ac8dd5d2d8ae3b362b2f86" into tink_syntaxhub/0.6.0/github/b6ea4966bbdee4d176ac8dd5d2d8ae3b362b2f86
|
||||
-lib tink_macro
|
||||
-lib tink_priority
|
||||
-cp ${HAXE_LIBCACHE}/tink_syntaxhub/0.6.0/github/b6ea4966bbdee4d176ac8dd5d2d8ae3b362b2f86/src
|
||||
-D tink_syntaxhub=0.6.0
|
||||
--macro tink.SyntaxHub.use()
|
@@ -1,4 +0,0 @@
|
||||
# @install: lix --silent download "haxelib:/tink_typecrawler#0.7.0" into tink_typecrawler/0.7.0/haxelib
|
||||
-lib tink_macro
|
||||
-cp ${HAXE_LIBCACHE}/tink_typecrawler/0.7.0/haxelib/src
|
||||
-D tink_typecrawler=0.7.0
|
@@ -1,3 +0,0 @@
|
||||
# @install: lix --silent download "haxelib:/uuid#2.4.1" into uuid/2.4.1/haxelib
|
||||
-cp ${HAXE_LIBCACHE}/uuid/2.4.1/haxelib/src
|
||||
-D uuid=2.4.1
|
@@ -1,4 +0,0 @@
|
||||
# @install: lix --silent download "haxelib:/vscode#1.60.0" into vscode/1.60.0/haxelib
|
||||
-lib hxnodejs
|
||||
-cp ${HAXE_LIBCACHE}/vscode/1.60.0/haxelib/src
|
||||
-D vscode=1.60.0
|
2125
projects/_standalone/kiss-vscode/package-lock.json
generated
2125
projects/_standalone/kiss-vscode/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,130 +0,0 @@
|
||||
{
|
||||
"main": "bin/extension.js",
|
||||
"name": "kiss-vscode",
|
||||
"description": "Kiss language plugin",
|
||||
"repository": {
|
||||
"url": "https://github.com/NQNStudios/kisslang.git",
|
||||
"type:": "git"
|
||||
},
|
||||
"homepage": "https://github.com/NQNStudios/kisslang/blob/master/projects/kiss-vscode/README.md",
|
||||
"categories": [
|
||||
"Programming Languages",
|
||||
"Extension Packs"
|
||||
],
|
||||
"extensionPack": [
|
||||
"2gua.rainbow-brackets"
|
||||
],
|
||||
"publisher": "NQNStudios",
|
||||
"contributes": {
|
||||
"grammars": [
|
||||
{
|
||||
"language": "kiss",
|
||||
"path": "./syntaxes/kiss.tmLanguage",
|
||||
"scopeName": "source.kiss"
|
||||
},
|
||||
{
|
||||
"path": "./syntaxes/codeblock.json",
|
||||
"injectTo": [
|
||||
"text.html.markdown"
|
||||
],
|
||||
"scopeName": "markdown.kiss.codeblock",
|
||||
"embeddedLanguages": {
|
||||
"meta.embedded.block.superjs": "kiss"
|
||||
}
|
||||
}
|
||||
],
|
||||
"keybindings": [
|
||||
{
|
||||
"command": "kiss-vscode.updateExtension",
|
||||
"mac": "Cmd+; Cmd+u",
|
||||
"key": "Ctrl+; Ctrl+u"
|
||||
},
|
||||
{
|
||||
"command": "kiss-vscode.evalAndPrint",
|
||||
"mac": "Cmd+; Cmd+e",
|
||||
"key": "Ctrl+; Ctrl+e"
|
||||
},
|
||||
{
|
||||
"command": "kiss-vscode.newKissClass",
|
||||
"mac": "Cmd+; Cmd+n",
|
||||
"key": "Ctrl+; Ctrl+n"
|
||||
},
|
||||
{
|
||||
"command": "kiss-vscode.showCorrespondingFile",
|
||||
"mac": "Cmd+; Cmd+f",
|
||||
"key": "Ctrl+; Ctrl+f"
|
||||
},
|
||||
{
|
||||
"command": "kiss-vscode.insertUTestCase",
|
||||
"mac": "Cmd+; Cmd+c",
|
||||
"key": "Ctrl+; Ctrl+c"
|
||||
},
|
||||
{
|
||||
"command": "kiss-vscode.mapLinesSync",
|
||||
"mac": "Cmd+; Cmd+m",
|
||||
"key": "Ctrl+; Ctrl+m"
|
||||
},
|
||||
{
|
||||
"command": "kiss-vscode.sortLinesSync",
|
||||
"mac": "Cmd+; Cmd+s",
|
||||
"key": "Ctrl+; Ctrl+s"
|
||||
}
|
||||
],
|
||||
"commands": [
|
||||
{
|
||||
"title": "kiss-vscode: Update and reinstall the Kiss-Vscode extension you are editing",
|
||||
"command": "kiss-vscode.updateExtension"
|
||||
},
|
||||
{
|
||||
"title": "kiss-vscode: Check test.sh, then update and reinstall the kiss-vscode extension you are editing",
|
||||
"command": "kiss-vscode.testAndUpdateExtension"
|
||||
},
|
||||
{
|
||||
"title": "kiss-vscode: Evaluate and print a kiss expression's value",
|
||||
"command": "kiss-vscode.evalAndPrint"
|
||||
},
|
||||
{
|
||||
"title": "kiss-vscode: Create a new kiss class",
|
||||
"command": "kiss-vscode.newKissClass"
|
||||
},
|
||||
{
|
||||
"title": "kiss-vscode: Open the corresponding .kiss/.hx file to this one",
|
||||
"command": "kiss-vscode.showCorrespondingFile"
|
||||
},
|
||||
{
|
||||
"title": "kiss-vscode: Generate a UTest test case in this .hx/.kiss file",
|
||||
"command": "kiss-vscode.insertUTestCase"
|
||||
},
|
||||
{
|
||||
"title": "kiss-vscode: Transform the selected text lines using a String->String kiss function",
|
||||
"command": "kiss-vscode.mapLinesSync"
|
||||
},
|
||||
{
|
||||
"title": "kiss-vscode: Sort the selected text lines using a (String,String)->Int comparator function",
|
||||
"command": "kiss-vscode.sortLinesSync"
|
||||
}
|
||||
],
|
||||
"languages": [
|
||||
{
|
||||
"id": "kiss",
|
||||
"configuration": "./Kiss.configuration.json",
|
||||
"extensions": [
|
||||
".kiss"
|
||||
],
|
||||
"aliases": [
|
||||
"Kiss",
|
||||
"kiss"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^1.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vsce": "^2.15.0"
|
||||
},
|
||||
"version": "0.0.18",
|
||||
"activationEvents": [],
|
||||
"displayName": "kiss-vscode"
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
import vscode.*;
|
||||
import Sys;
|
||||
import sys.io.File;
|
||||
import sys.FileSystem;
|
||||
import kiss.Prelude;
|
||||
import haxe.io.Path;
|
||||
import js.Node;
|
||||
import js.node.ChildProcess;
|
||||
import uuid.Uuid;
|
||||
import re_flex.R;
|
||||
|
||||
using haxe.io.Path;
|
||||
using StringTools;
|
||||
using uuid.Uuid;
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
class Main {}
|
@@ -1,11 +0,0 @@
|
||||
(loadFrom "kiss-vscode-api" "src/Util.kiss")
|
||||
(loadFrom "kiss-vscode-api" "src/KissUtil.kiss")
|
||||
|
||||
@(:expose "activate")
|
||||
(function activate [:ExtensionContext context]
|
||||
(printThroughInfoMessage)
|
||||
(awaitLetCatchThroughErrorMessage)
|
||||
(allowRuntimeConversion)
|
||||
(load "commands/ExtensionTools.kiss")
|
||||
(load "commands/KissTools.kiss")
|
||||
(load "commands/Lines.kiss"))
|
@@ -1,45 +0,0 @@
|
||||
(loadFrom "kiss-vscode-api" "src/Util.kiss")
|
||||
|
||||
(function extensionPath [] .fsPath .uri (first Vscode.workspace.workspaceFolders))
|
||||
(function :ChildProcessSpawnSyncOptions options [] (object cwd (extensionPath)))
|
||||
|
||||
(function handleUpdateFailure [error]
|
||||
(showCompileError "Error updating Kiss-VSCode: $error")
|
||||
(object)
|
||||
**(throw error))
|
||||
|
||||
(defMacro forceUpdateFailure [error]
|
||||
`{
|
||||
(statusBarItem.hide)
|
||||
(statusBarItem.dispose)
|
||||
(handleUpdateFailure ,error)
|
||||
(return)
|
||||
})
|
||||
|
||||
(var &mut :StatusBarItem statusBarItem null)
|
||||
(defCommand context updateExtension "Update and reinstall the Kiss-Vscode extension you are editing" "C-; C-u" []
|
||||
(set statusBarItem (Vscode.window.createStatusBarItem))
|
||||
(set statusBarItem.text "\$(loading~spin) Compiling extension")
|
||||
(statusBarItem.show)
|
||||
(if (= "Windows" (Sys.systemName))
|
||||
(trySpawnSync "cmd.exe" ["/c" "npm" "install"] (options) forceUpdateFailure)
|
||||
(trySpawnSync "npm" ["install"] (options) forceUpdateFailure))
|
||||
(trySpawnSync "haxe" ["build.hxml"] (options) forceUpdateFailure)
|
||||
(awaitLet [_ (executeCommand
|
||||
"workbench.extensions.command.installFromVSIX"
|
||||
(Uri.file (joinPath (extensionPath) (last (filter (FileSystem.readDirectory (extensionPath)) ->file (file.endsWith ".vsix"))))))]
|
||||
|
||||
(catch [error]
|
||||
(statusBarItem.hide)
|
||||
(statusBarItem.dispose)
|
||||
(handleUpdateFailure error))
|
||||
|
||||
(statusBarItem.hide)
|
||||
(statusBarItem.dispose))
|
||||
|
||||
{}
|
||||
null)
|
||||
|
||||
(defCommand context testAndUpdateExtension "Check test.sh, then update and reinstall the kiss-vscode extension you are editing" "" []
|
||||
(trySpawnSync "test.sh" [] (options) handleUpdateFailure)
|
||||
(updateExtension))
|
@@ -1,77 +0,0 @@
|
||||
(defCommand context evalAndPrint "Evaluate and print a kiss expression's value" "C-; C-e" []
|
||||
(let [st (selectedText)]
|
||||
(withValueOrInputEditor st "kiss.evalAndPrint" "A kiss expression to evaluate"
|
||||
(infoMessage (Std.string (evalString st))))))
|
||||
|
||||
(defCommand context newKissClass "Create a new kiss class" "C-; C-n" []
|
||||
(awaitLet [className (inputBox)]
|
||||
(when className
|
||||
(let [currentFile
|
||||
activeTextEditor.document.fileName
|
||||
currentFileDirectory
|
||||
(Path.directory currentFile)
|
||||
haxeFile
|
||||
(joinPath currentFileDirectory "${className}.hx")
|
||||
kissFile
|
||||
(joinPath currentFileDirectory "${className}.kiss")
|
||||
// Try to use the same package statement from the first line of the
|
||||
// currently open Kiss class's .hx file
|
||||
pkg
|
||||
(or
|
||||
(try
|
||||
(let [currentHaxeFile
|
||||
(currentFile.withExtension "hx")]
|
||||
(first (.split (File.getContent currentHaxeFile) "\n")))
|
||||
(catch [e] ""))
|
||||
// Default to no specific package declaration
|
||||
"package;")]
|
||||
(File.saveContent haxeFile
|
||||
"${pkg}
|
||||
|
||||
import kiss.Prelude;
|
||||
import kiss.List;
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
class ${className} {}
|
||||
")
|
||||
(File.saveContent kissFile "")
|
||||
(awaitLet [_ (showTextDocument (Uri.file haxeFile) (object viewColumn ViewColumn.Active))]
|
||||
(executeCommand "workbench.action.keepEditor")
|
||||
(awaitLet [_ (showTextDocument (Uri.file kissFile) (object viewColumn ViewColumn.Beside))]
|
||||
(executeCommand "workbench.action.keepEditor")))))))
|
||||
|
||||
(function correspondingFile [:String kissOrHxFile]
|
||||
(let [base
|
||||
(kissOrHxFile.withoutExtension)
|
||||
ext
|
||||
(kissOrHxFile.extension)
|
||||
correspondingExt
|
||||
(case ext
|
||||
("hx" "kiss")
|
||||
("kiss" "hx")
|
||||
(otherwise (throw "No corresponding file for ${kissOrHxFile}")))]
|
||||
"${base}.${correspondingExt}"))
|
||||
|
||||
(defCommand context showCorrespondingFile "Open the corresponding .kiss/.hx file to this one" "C-; C-f" []
|
||||
(showTextDocument (Uri.file (correspondingFile .fileName .document activeTextEditor))))
|
||||
|
||||
(defCommand context insertUTestCase "Generate a UTest test case in this .hx/.kiss file" "C-; C-c" []
|
||||
(awaitLet [testName (inputBox)
|
||||
&sync testName
|
||||
"$(.toUpperCase (testName.substr 0 1))$(testName.substr 1)"
|
||||
_ (insert
|
||||
"function test${testName}() {
|
||||
_test${testName}();
|
||||
}
|
||||
")
|
||||
_ (showTextDocument (Uri.file (correspondingFile .fileName .document activeTextEditor)))
|
||||
&sync pos (activeTextEditor.document.positionAt .length (activeTextEditor.document.getText))
|
||||
_ (insertAt pos
|
||||
"
|
||||
|
||||
(function _test${testName} []
|
||||
(Assert.pass))
|
||||
")
|
||||
&sync endPos (activeTextEditor.document.positionAt .length (activeTextEditor.document.getText))]
|
||||
(activeTextEditor.revealRange (new Range pos endPos))
|
||||
(set activeTextEditor.selection (new Selection pos endPos))))
|
@@ -1,35 +0,0 @@
|
||||
// Perform a synchronous transformation on each selected line of text
|
||||
(function _mapLinesSync [selectedText mapFunc]
|
||||
(let [:String->String safeMapFunc
|
||||
->[line]
|
||||
(ifLet [trimmedLine (StringTools.trim line)] (try (mapFunc trimmedLine) (catch [e] (Std.string e))) "")
|
||||
mappedText
|
||||
(.join
|
||||
(map
|
||||
(.split selectedText "\n")
|
||||
safeMapFunc)
|
||||
"\n")]
|
||||
(.edit activeTextEditor
|
||||
(lambda [e]
|
||||
(let [editor activeTextEditor]
|
||||
(e.delete editor.selection)
|
||||
(e.insert editor.selection.active mappedText))))))
|
||||
|
||||
(defCommand context mapLinesSync "Transform the selected text lines using a String->String kiss function" "C-; C-m" []
|
||||
(awaitLet [mapFuncStr (inputEditor "mapLinesFunc.kiss" "a String->String function through which to map the selected lines")]
|
||||
(let [:String->String mapFunc (evalString mapFuncStr)]
|
||||
(_mapLinesSync (selectedText) mapFunc))))
|
||||
|
||||
// Sort the selected lines of text using a comparison function (String,String) -> Int
|
||||
(function _sortLinesSync [selectedText :Dynamic compareFunc]
|
||||
(let [lines (selectedText.split "\n")]
|
||||
(lines.sort compareFunc)
|
||||
(.edit activeTextEditor
|
||||
(lambda [e]
|
||||
(let [editor activeTextEditor]
|
||||
(e.delete editor.selection)
|
||||
(e.insert editor.selection.active (lines.join "\n")))))))
|
||||
|
||||
(defCommand context sortLinesSync "Sort the selected text lines using a (String,String)->Int comparator function" "C-; C-s" []
|
||||
(awaitLet [compareFuncStr (inputEditor "sortLinesFunc.kiss" "a (String,String) -> Int function with which to sort the selected lines")]
|
||||
(_sortLinesSync (selectedText) (if (< 0 compareFuncStr.length) (evalString compareFuncStr) Reflect.compare))))
|
@@ -1,19 +0,0 @@
|
||||
// Commands that kind of emulate EMACS commands
|
||||
|
||||
// Before you use commands in this file:
|
||||
/* (loadFrom "kiss-vscode" "src/commands/EmacsPorts.kiss") */
|
||||
|
||||
// Open any file in VSCode, creating it if necessary
|
||||
(function :Void _forceOpenFile [:String file]
|
||||
(let [&mut uri (Uri.file file)]
|
||||
(unless (FileSystem.exists file)
|
||||
(set uri (uri.with (object scheme "untitled"))))
|
||||
(awaitLet [doc (openTextDocument uri)]
|
||||
(showTextDocument doc))))
|
||||
|
||||
/*
|
||||
(registerCommand "[xf] emacs find-file" ->[&opt _] (findFile "path/to/dir"))
|
||||
*/
|
||||
// TODO use current file's containing folder as a default
|
||||
(function :Void findFile [&opt :String dir]
|
||||
(chooseFileInDir _forceOpenFile true dir))
|
@@ -1,28 +0,0 @@
|
||||
{
|
||||
"fileTypes": [],
|
||||
"injectionSelector": "H:markup.fenced_code.block.markdown",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#superjs-code-block"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"superjs-code-block": {
|
||||
"begin": "(?<=[`~])kiss(\\s+[^`~]*)?$",
|
||||
"end": "(^|\\G)(?=\\s*[`~]{3,}\\s*$)",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(^|\\G)(\\s*)(.*)",
|
||||
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
|
||||
"contentName": "meta.embedded.block.kiss",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.kiss"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"scopeName": "markdown.kiss.codeblock"
|
||||
}
|
@@ -1,198 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>comment</key>
|
||||
<string></string>
|
||||
<key>fileTypes</key>
|
||||
<array>
|
||||
<string>kiss</string>
|
||||
</array>
|
||||
<key>foldingStartMarker</key>
|
||||
<string>\(</string>
|
||||
<key>foldingStopMarker</key>
|
||||
<string>\)</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^~H</string>
|
||||
<key>name</key>
|
||||
<string>Kiss</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.kiss</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(;|//).*$\n?</string>
|
||||
<key>name</key>
|
||||
<string>comment.line.semicolon.kiss</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>storage.type.function-type.kiss</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>entity.name.function.kiss</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(?:\()((?i:defmacro|defMacro|defun|function|defmethod|method|def[A-Z]\S+))\s+((?:\w|[+\-<>/*&=.?!$%:@\[\]^{}~#|])+)</string>
|
||||
<key>name</key>
|
||||
<string>meta.function.kiss</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?<=\s)(?i:&opt|&rest|&body)(?=\s+)</string>
|
||||
<key>name</key>
|
||||
<string>meta.function-parameters.kiss</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>storage.type.function-type.kiss</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>entity.name.variable.kiss</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(?:\()((?i:defvar|defprop|var|prop))\s+((?:\w|[+\-<>/*&=.?!$%:@\[\]^{}~#|])+)</string>
|
||||
</dict>
|
||||
<!-- <dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.constant.kiss</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(#)(\w|[\\+-=<>'"&#])+</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.kiss</string>
|
||||
</dict> -->
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.variable.kiss</string>
|
||||
</dict>
|
||||
<key>3</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.variable.kiss</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(?<=^|\s|[()])(\*)(\S*)(\*)(?=$|\s|[()])</string>
|
||||
<key>name</key>
|
||||
<string>variable.other.global.kiss</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?<=^|\s|[()]):(\w|[+\-<>/*&=.?!$%:@\[\]^{}~#|])*</string>
|
||||
<key>name</key>
|
||||
<string>keyword.constant.kiss</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<!-- TODO cut this down and add some missing ones -->
|
||||
<string>(?<=\()(?i:\*|\*\*|\*\*\*|\+|\+\+|\+\+\+|\-|/|//|///|/=|<|<=|=|>|>=|and|apply|assert|begin|break|case|catch|concat|cond|continue|count|defMacro|defReaderMacro|defun|defmethod|method|function|defvar|var|defprop|prop|for|doFor|eighth|eval|fifth|first|fourth|localFunction|localVar|symbol|if|load|withFunction|withFunctions|lambda|last|let|loop|map|max|min|ninth|not|nth|setNth|getDict|setDict|or|otherwise|print|rest|return|reverse|second|set|sixth|Some|sort|symbolName|symbolNameValue|tenth|the|third|throw|trace|when|unless|ifLet|whenLet|unlessLet|forCase|doForCase|with[A-Z]\S+)(?=\s+)</string>
|
||||
<key>name</key>
|
||||
<string>keyword.control.kiss</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?<=^|\s|[()])(?i:null|true|false)(?=$|\s|[()])</string>
|
||||
<key>name</key>
|
||||
<string>constant.language.kiss</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b</string>
|
||||
<key>name</key>
|
||||
<string>constant.numeric.kiss</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>"</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.begin.kiss</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>"</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.end.kiss</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>string.quoted.double.kiss</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\\.</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escape.kiss</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(#+)"</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.begin.kiss</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>"\1</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.end.kiss</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>string.quoted.double.kiss</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>scopeName</key>
|
||||
<string>source.kiss</string>
|
||||
<key>uuid</key>
|
||||
<string>00D451C9-6B1D-11D9-8DFA-000D93589AF6</string>
|
||||
</dict>
|
||||
</plist>
|
@@ -1,3 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
haxe build.hxml
|
Reference in New Issue
Block a user