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

Deprecate rust-lang.rust #956

Merged
merged 5 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Rust support for Visual Studio Code
# Rust support for Visual Studio Code (deprecated)

[![](https://vsmarketplacebadge.apphb.com/version/rust-lang.rust.svg)](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust)
[![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)

> Note: This extension has been deprecated in favor of the [rust-analyzer project](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).

Adds language support for Rust to Visual Studio Code. Supports:

* code completion
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rust",
"displayName": "Rust",
"displayName": "Rust (deprecated)",
"description": "Rust for Visual Studio Code (powered by Rust Language Server/Rust Analyzer). Provides lints, code completion and navigation, formatting and more.",
"version": "0.7.8",
"publisher": "rust-lang",
Expand Down Expand Up @@ -485,6 +485,11 @@
],
"default": null,
"description": "When specified, uses the rust-analyzer binary at a given path"
},
"rust.ignore_deprecation_warning": {
"type": "boolean",
"default": false,
"description": "Whether to surpress the deprecation notification on start up."
}
}
},
Expand Down
38 changes: 37 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,45 @@ export async function activate(context: ExtensionContext): Promise<Api> {
// since VSCode doesn't do that on startup by itself.
onDidChangeActiveTextEditor(window.activeTextEditor);

const config = workspace.getConfiguration();
if (!config.get<boolean>('rust.ignore_deprecation_warning', false)) {
window
.showWarningMessage(
'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',
'Open in your browser',
'Open in a new editor tab',
'Disable Warning',
)
.then(button => {
switch (button) {
case 'Disable Warning':
config.update(
'rust.ignore_deprecation_warning',
true,
ConfigurationTarget.Global,
);
break;
case 'Open in your browser':
commands.executeCommand(
'vscode.open',
Uri.parse(
'https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer',
),
);
break;
case 'Open in a new editor tab':
commands.executeCommand(
'vscode.open',
Uri.parse('vscode:extension/rust-lang.rust-analyzer'),
);
break;
default:
}
});
}

// Migrate the users of multi-project setup for RLS to disable the setting
// entirely (it's always on now)
const config = workspace.getConfiguration();
if (
typeof config.get<boolean | null>(
'rust-client.enableMultiProjectSetup',
Expand Down