mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-31 15:47:31 +00:00
npm run fix
This commit is contained in:
parent
02f18abc55
commit
f1ba963a30
2 changed files with 22 additions and 10 deletions
|
@ -25,7 +25,11 @@ export class HintsUpdater {
|
||||||
public async loadHints(
|
public async loadHints(
|
||||||
editor: vscode.TextEditor | undefined
|
editor: vscode.TextEditor | undefined
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (this.displayHints && editor !== undefined && this.isRustDocument(editor.document)) {
|
if (
|
||||||
|
this.displayHints &&
|
||||||
|
editor !== undefined &&
|
||||||
|
this.isRustDocument(editor.document)
|
||||||
|
) {
|
||||||
await this.updateDecorationsFromServer(
|
await this.updateDecorationsFromServer(
|
||||||
editor.document.uri.toString(),
|
editor.document.uri.toString(),
|
||||||
editor
|
editor
|
||||||
|
|
|
@ -152,15 +152,23 @@ export function activate(context: vscode.ExtensionContext) {
|
||||||
if (Server.config.displayInlayHints) {
|
if (Server.config.displayInlayHints) {
|
||||||
const hintsUpdater = new HintsUpdater();
|
const hintsUpdater = new HintsUpdater();
|
||||||
hintsUpdater.loadHints(vscode.window.activeTextEditor).then(() => {
|
hintsUpdater.loadHints(vscode.window.activeTextEditor).then(() => {
|
||||||
disposeOnDeactivation(vscode.window.onDidChangeActiveTextEditor(editor =>
|
disposeOnDeactivation(
|
||||||
hintsUpdater.loadHints(editor)
|
vscode.window.onDidChangeActiveTextEditor(editor =>
|
||||||
));
|
hintsUpdater.loadHints(editor)
|
||||||
disposeOnDeactivation(vscode.workspace.onDidChangeTextDocument(e =>
|
)
|
||||||
hintsUpdater.updateHints(e)
|
);
|
||||||
));
|
disposeOnDeactivation(
|
||||||
disposeOnDeactivation(vscode.workspace.onDidChangeConfiguration(_ =>
|
vscode.workspace.onDidChangeTextDocument(e =>
|
||||||
hintsUpdater.toggleHintsDisplay(Server.config.displayInlayHints)
|
hintsUpdater.updateHints(e)
|
||||||
));
|
)
|
||||||
|
);
|
||||||
|
disposeOnDeactivation(
|
||||||
|
vscode.workspace.onDidChangeConfiguration(_ =>
|
||||||
|
hintsUpdater.toggleHintsDisplay(
|
||||||
|
Server.config.displayInlayHints
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue