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