Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit 8dbe67d

Browse files
authored
Merge pull request #956 from Veykril/master
2 parents b1ae67b + 0388a39 commit 8dbe67d

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Rust support for Visual Studio Code
1+
# Rust support for Visual Studio Code (deprecated)
22

33
[![](https://vsmarketplacebadge.apphb.com/version/rust-lang.rust.svg)](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust)
44
[![VSCode + Node.js CI](https://img.shields.io/github/workflow/status/rust-lang/rls-vscode/VSCode%20+%20Node.js%20CI.svg?logo=github)](https://github.com/rust-lang/rls-vscode/actions?query=workflow%3A%22VSCode+%2B+Node.js+CI%22)
55

6+
> Note: This extension has been deprecated in favor of the [rust-analyzer project](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).
7+
68
Adds language support for Rust to Visual Studio Code. Supports:
79

810
* code completion

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rust",
3-
"displayName": "Rust",
3+
"displayName": "Rust (deprecated)",
44
"description": "Rust for Visual Studio Code (powered by Rust Language Server/Rust Analyzer). Provides lints, code completion and navigation, formatting and more.",
55
"version": "0.7.8",
66
"publisher": "rust-lang",
@@ -485,6 +485,11 @@
485485
],
486486
"default": null,
487487
"description": "When specified, uses the rust-analyzer binary at a given path"
488+
},
489+
"rust.ignore_deprecation_warning": {
490+
"type": "boolean",
491+
"default": false,
492+
"description": "Whether to surpress the deprecation notification on start up."
488493
}
489494
}
490495
},

src/extension.ts

+37-1
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,45 @@ export async function activate(context: ExtensionContext): Promise<Api> {
4444
// since VSCode doesn't do that on startup by itself.
4545
onDidChangeActiveTextEditor(window.activeTextEditor);
4646

47+
const config = workspace.getConfiguration();
48+
if (!config.get<boolean>('rust.ignore_deprecation_warning', false)) {
49+
window
50+
.showWarningMessage(
51+
'rust-lang.rust has been deprecated. Please uninstall this extension and install rust-lang.rust-analyzer instead. You can find the extension by clicking on one of the buttons',
52+
'Open in your browser',
53+
'Open in a new editor tab',
54+
'Disable Warning',
55+
)
56+
.then(button => {
57+
switch (button) {
58+
case 'Disable Warning':
59+
config.update(
60+
'rust.ignore_deprecation_warning',
61+
true,
62+
ConfigurationTarget.Global,
63+
);
64+
break;
65+
case 'Open in your browser':
66+
commands.executeCommand(
67+
'vscode.open',
68+
Uri.parse(
69+
'https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer',
70+
),
71+
);
72+
break;
73+
case 'Open in a new editor tab':
74+
commands.executeCommand(
75+
'vscode.open',
76+
Uri.parse('vscode:extension/rust-lang.rust-analyzer'),
77+
);
78+
break;
79+
default:
80+
}
81+
});
82+
}
83+
4784
// Migrate the users of multi-project setup for RLS to disable the setting
4885
// entirely (it's always on now)
49-
const config = workspace.getConfiguration();
5086
if (
5187
typeof config.get<boolean | null>(
5288
'rust-client.enableMultiProjectSetup',

0 commit comments

Comments
 (0)