aboutsummaryrefslogtreecommitdiff
path: root/editors/code
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/src/commands/runnables.ts16
-rw-r--r--editors/code/src/extension.ts3
2 files changed, 19 insertions, 0 deletions
diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts
index be17c8944..f9a4e2fc9 100644
--- a/editors/code/src/commands/runnables.ts
+++ b/editors/code/src/commands/runnables.ts
@@ -103,3 +103,19 @@ export async function handle() {
103 return await vscode.tasks.executeTask(task); 103 return await vscode.tasks.executeTask(task);
104 } 104 }
105} 105}
106
107export async function handleSingle(runnable: Runnable) {
108 const editor = vscode.window.activeTextEditor;
109 if (editor == null || editor.document.languageId !== 'rust') {
110 return;
111 }
112
113 const task = createTask(runnable);
114 task.group = vscode.TaskGroup.Build;
115 task.presentationOptions = {
116 reveal: vscode.TaskRevealKind.Always,
117 panel: vscode.TaskPanelKind.Dedicated,
118 };
119
120 return vscode.tasks.executeTask(task);
121} \ No newline at end of file
diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts
index 4acd54d90..9edfb13b5 100644
--- a/editors/code/src/extension.ts
+++ b/editors/code/src/extension.ts
@@ -55,6 +55,9 @@ export function activate(context: vscode.ExtensionContext) {
55 ); 55 );
56 overrideCommand('type', commands.onEnter.handle); 56 overrideCommand('type', commands.onEnter.handle);
57 57
58 // Unlike the above this does not send requests to the language server
59 registerCommand('ra-lsp.run-single', commands.runnables.handleSingle);
60
58 // Notifications are events triggered by the language server 61 // Notifications are events triggered by the language server
59 const allNotifications: Iterable< 62 const allNotifications: Iterable<
60 [string, lc.GenericNotificationHandler] 63 [string, lc.GenericNotificationHandler]