kvscode showCorrspondingFile
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
(whenLet [text (selectedText)] (set selectedTextBeforeShortcut text))
|
||||
(if activeTextEditor
|
||||
(set documentBeforeShortcut activeTextEditor.document)
|
||||
(set documentBeforeShortcut null))
|
||||
(unless prefixMap (set documentBeforeShortcut null)))
|
||||
|
||||
// When called without a prefixMap, if a shortcut panel is still open, close it and start over:
|
||||
(unless prefixMap
|
||||
@@ -217,9 +217,10 @@
|
||||
// KissTools.kiss:
|
||||
(registerCommand "[K]iss: [e]valuate and print an expression" evalAndPrint)
|
||||
(registerCommand "[K]iss: create [n]ew kiss class" newKissClass)
|
||||
(registerCommand "[K]iss: open corresponding .kiss/.hx [f]ile" showCorrespondingFile)
|
||||
// ExtensionTools.kiss:
|
||||
(registerCommand "[K]iss: [u]pdate Kiss-VSCode" updateKissVscode)
|
||||
(registerCommand "[K]iss: [t]est and [u]pdate Kiss-VSCode" updateKissVscode))
|
||||
(registerCommand "[K]iss: [t]est and [u]pdate Kiss-VSCode" testAndUpdateKissVscode))
|
||||
|
||||
// TODO standardize this with KissInterp
|
||||
(function :Void prepareInterp []
|
||||
|
@@ -38,6 +38,12 @@
|
||||
(set promise (promise.then iteration)))
|
||||
promise))
|
||||
|
||||
// Other
|
||||
|
||||
(defAlias &call showTextDocument Vscode.window.showTextDocument)
|
||||
|
||||
// Macros for implementing commands in Kiss
|
||||
|
||||
(defMacro withValueOrInputBox [v &body body]
|
||||
`(if ,v
|
||||
{,@body}
|
||||
|
@@ -34,4 +34,19 @@ import kiss.List;
|
||||
class ${className} {}
|
||||
")
|
||||
(File.saveContent kissFile "")
|
||||
(Vscode.window.showTextDocument (Uri.file kissFile))))))
|
||||
(showTextDocument (Uri.file kissFile))))))
|
||||
|
||||
(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}"))
|
||||
|
||||
(function showCorrespondingFile [&opt _]
|
||||
(showTextDocument (Uri.file (correspondingFile activeTextEditor.document.fileName))))
|
Reference in New Issue
Block a user