npm run fix

This commit is contained in:
Kirill Bulatov 2019-07-25 15:54:20 +03:00
parent 02f18abc55
commit f1ba963a30
2 changed files with 22 additions and 10 deletions

View file

@ -25,7 +25,11 @@ export class HintsUpdater {
public async loadHints(
editor: vscode.TextEditor | undefined
): Promise<void> {
if (this.displayHints && editor !== undefined && this.isRustDocument(editor.document)) {
if (
this.displayHints &&
editor !== undefined &&
this.isRustDocument(editor.document)
) {
await this.updateDecorationsFromServer(
editor.document.uri.toString(),
editor

View file

@ -152,15 +152,23 @@ export function activate(context: vscode.ExtensionContext) {
if (Server.config.displayInlayHints) {
const hintsUpdater = new HintsUpdater();
hintsUpdater.loadHints(vscode.window.activeTextEditor).then(() => {
disposeOnDeactivation(vscode.window.onDidChangeActiveTextEditor(editor =>
disposeOnDeactivation(
vscode.window.onDidChangeActiveTextEditor(editor =>
hintsUpdater.loadHints(editor)
));
disposeOnDeactivation(vscode.workspace.onDidChangeTextDocument(e =>
)
);
disposeOnDeactivation(
vscode.workspace.onDidChangeTextDocument(e =>
hintsUpdater.updateHints(e)
));
disposeOnDeactivation(vscode.workspace.onDidChangeConfiguration(_ =>
hintsUpdater.toggleHintsDisplay(Server.config.displayInlayHints)
));
)
);
disposeOnDeactivation(
vscode.workspace.onDidChangeConfiguration(_ =>
hintsUpdater.toggleHintsDisplay(
Server.config.displayInlayHints
)
)
);
});
}
}