Skip to content

Commit f08318f

Browse files
Add codelens command to copy models (#18)
1 parent 48d1cb5 commit f08318f

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"publisher": "Imandra",
77
"icon": "assets/vscode-imandra-avatar.png",
88
"license": "MIT",
9-
"version": "0.0.10",
9+
"version": "0.0.11",
1010
"repository": {
1111
"type": "git",
1212
"url": "https://github.com/imandra-ai/imandrax-vscode"

src/extension.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
Executable,
2323
LanguageClient,
2424
LanguageClientOptions,
25+
VersionedTextDocumentIdentifier,
2526
} from "vscode-languageclient/node";
2627

2728
const MAX_RESTARTS: number = 10;
@@ -168,6 +169,8 @@ export async function start() {
168169

169170
client.onRequest("$imandrax/interact-model", (params) => { interact_model(params); });
170171

172+
client.onRequest("$imandrax/copy-model", (params) => { copy_model(params); });
173+
171174
// Start the client. This will also launch the server.
172175
client.start();
173176
}
@@ -285,6 +288,16 @@ function interact_model(params) {
285288
t.show();
286289
}
287290

291+
function copy_model(params) {
292+
const models = params["models"];
293+
let str = "";
294+
models.join();
295+
models.forEach(async m => {
296+
str += m;
297+
});
298+
env.clipboard.writeText(str);
299+
}
300+
288301
function clear_cache() {
289302
client.sendRequest("workspace/executeCommand", { "command": "clear-cache", "arguments": [] });
290303
return true;

0 commit comments

Comments
 (0)