aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/README.md2
-rw-r--r--editors/code/src/commands/runnables.ts16
-rw-r--r--editors/code/src/extension.ts3
3 files changed, 20 insertions, 1 deletions
diff --git a/editors/README.md b/editors/README.md
index a63ced725..5b09750e6 100644
--- a/editors/README.md
+++ b/editors/README.md
@@ -1,7 +1,7 @@
1To install experimental VS Code plugin: 1To install experimental VS Code plugin:
2 2
3``` 3```
4$ git clone https://github.com/rust-analyzer/rust-analyzer.git 4$ git clone https://github.com/rust-analyzer/rust-analyzer.git --depth 1
5$ cd rust-analyzer 5$ cd rust-analyzer
6$ cargo install-code 6$ cargo install-code
7``` 7```
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]