mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Show type decorators
This commit is contained in:
parent
1d68e6171e
commit
169e69d217
5 changed files with 175 additions and 1 deletions
|
@ -3,6 +3,7 @@ import * as lc from 'vscode-languageclient';
|
|||
|
||||
import * as commands from './commands';
|
||||
import { CargoWatchProvider } from './commands/cargo_watch';
|
||||
import { HintsUpdater } from './commands/inlay_hints';
|
||||
import {
|
||||
interactivelyStartCargoWatch,
|
||||
startCargoWatch
|
||||
|
@ -147,6 +148,16 @@ export function activate(context: vscode.ExtensionContext) {
|
|||
|
||||
// Start the language server, finally!
|
||||
startServer();
|
||||
|
||||
if (Server.config.displayInlayHints) {
|
||||
const hintsUpdater = new HintsUpdater();
|
||||
hintsUpdater.loadHints(vscode.window.activeTextEditor).then(() => {
|
||||
vscode.window.onDidChangeActiveTextEditor(editor => hintsUpdater.loadHints(editor));
|
||||
vscode.workspace.onDidChangeTextDocument(e => hintsUpdater.updateHints(e));
|
||||
vscode.workspace.onDidCloseTextDocument(document => hintsUpdater.dropHints(document));
|
||||
vscode.workspace.onDidChangeConfiguration(_ => hintsUpdater.toggleHintsDisplay(Server.config.displayInlayHints));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function deactivate(): Thenable<void> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue