From 41a1ec723ce2ea3fa78ae468830f0a77e5658307 Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Wed, 25 Dec 2019 16:44:42 +0100 Subject: Remove cargo-watch from vscode extension. Still keeps tests around for reference when porting them to rust --- editors/code/src/extension.ts | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'editors/code/src/extension.ts') diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts index 815f3692c..72a4d4bf2 100644 --- a/editors/code/src/extension.ts +++ b/editors/code/src/extension.ts @@ -2,13 +2,8 @@ import * as vscode from 'vscode'; import * as lc from 'vscode-languageclient'; import * as commands from './commands'; -import { CargoWatchProvider } from './commands/cargo_watch'; import { ExpandMacroContentProvider } from './commands/expand_macro'; import { HintsUpdater } from './commands/inlay_hints'; -import { - interactivelyStartCargoWatch, - startCargoWatch, -} from './commands/runnables'; import { SyntaxTreeContentProvider } from './commands/syntaxTree'; import * as events from './events'; import * as notifications from './notifications'; @@ -139,26 +134,6 @@ export async function activate(context: vscode.ExtensionContext) { vscode.commands.registerCommand('rust-analyzer.reload', reloadCommand); - // Executing `cargo watch` provides us with inline diagnostics on save - let provider: CargoWatchProvider | undefined; - interactivelyStartCargoWatch(context).then(p => { - provider = p; - }); - registerCommand('rust-analyzer.startCargoWatch', () => { - if (provider) { - provider.start(); - } else { - startCargoWatch(context).then(p => { - provider = p; - }); - } - }); - registerCommand('rust-analyzer.stopCargoWatch', () => { - if (provider) { - provider.stop(); - } - }); - // Start the language server, finally! try { await startServer(); -- cgit v1.2.3 From 178c23f50549298aad0dc0f098f8ed510a57f9d6 Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Wed, 25 Dec 2019 19:08:44 +0100 Subject: Re-implement status display using LSP 3.15 progress event --- editors/code/src/extension.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'editors/code/src/extension.ts') diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts index 72a4d4bf2..1507cb26e 100644 --- a/editors/code/src/extension.ts +++ b/editors/code/src/extension.ts @@ -8,6 +8,7 @@ import { SyntaxTreeContentProvider } from './commands/syntaxTree'; import * as events from './events'; import * as notifications from './notifications'; import { Server } from './server'; +import { StatusDisplay } from './commands/watch_status'; export async function activate(context: vscode.ExtensionContext) { function disposeOnDeactivation(disposable: vscode.Disposable) { @@ -83,6 +84,9 @@ export async function activate(context: vscode.ExtensionContext) { overrideCommand('type', commands.onEnter.handle); } + const watchStatus = new StatusDisplay(Server.config.cargoCheckOptions.command || 'check'); + disposeOnDeactivation(watchStatus); + // Notifications are events triggered by the language server const allNotifications: Iterable<[ string, @@ -92,6 +96,10 @@ export async function activate(context: vscode.ExtensionContext) { 'rust-analyzer/publishDecorations', notifications.publishDecorations.handle, ], + [ + '$/progress', + (params) => watchStatus.handleProgressNotification(params), + ] ]; const syntaxTreeContentProvider = new SyntaxTreeContentProvider(); const expandMacroContentProvider = new ExpandMacroContentProvider(); -- cgit v1.2.3 From b9c10ed97f22d665b75895a387c633dfa412ed2b Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Wed, 25 Dec 2019 19:10:30 +0100 Subject: Re-format VSCode extension changes --- editors/code/src/extension.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'editors/code/src/extension.ts') diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts index 1507cb26e..36163b6bb 100644 --- a/editors/code/src/extension.ts +++ b/editors/code/src/extension.ts @@ -5,10 +5,10 @@ import * as commands from './commands'; import { ExpandMacroContentProvider } from './commands/expand_macro'; import { HintsUpdater } from './commands/inlay_hints'; import { SyntaxTreeContentProvider } from './commands/syntaxTree'; +import { StatusDisplay } from './commands/watch_status'; import * as events from './events'; import * as notifications from './notifications'; import { Server } from './server'; -import { StatusDisplay } from './commands/watch_status'; export async function activate(context: vscode.ExtensionContext) { function disposeOnDeactivation(disposable: vscode.Disposable) { @@ -84,7 +84,9 @@ export async function activate(context: vscode.ExtensionContext) { overrideCommand('type', commands.onEnter.handle); } - const watchStatus = new StatusDisplay(Server.config.cargoCheckOptions.command || 'check'); + const watchStatus = new StatusDisplay( + Server.config.cargoCheckOptions.command || 'check', + ); disposeOnDeactivation(watchStatus); // Notifications are events triggered by the language server @@ -98,8 +100,8 @@ export async function activate(context: vscode.ExtensionContext) { ], [ '$/progress', - (params) => watchStatus.handleProgressNotification(params), - ] + params => watchStatus.handleProgressNotification(params), + ], ]; const syntaxTreeContentProvider = new SyntaxTreeContentProvider(); const expandMacroContentProvider = new ExpandMacroContentProvider(); -- cgit v1.2.3 From 0cdbd0814958e174c5481d6bf16bd2a7e53ec981 Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Wed, 25 Dec 2019 20:23:44 +0100 Subject: Keep VSCode config mostly backwards compatible --- editors/code/src/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editors/code/src/extension.ts') diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts index 36163b6bb..1da10ebd0 100644 --- a/editors/code/src/extension.ts +++ b/editors/code/src/extension.ts @@ -85,7 +85,7 @@ export async function activate(context: vscode.ExtensionContext) { } const watchStatus = new StatusDisplay( - Server.config.cargoCheckOptions.command || 'check', + Server.config.cargoWatchOptions.command, ); disposeOnDeactivation(watchStatus); -- cgit v1.2.3