about summary refs log tree commit diff
path: root/editors/code/src
diff options
context:
space:
mode:
authorVeetaha <gerzoh1@gmail.com>2020-03-07 14:34:09 +0200
committerVeetaha <gerzoh1@gmail.com>2020-03-07 14:34:09 +0200
commit2734ffa20c4c38f57bb6808d6cf87d0a8aaf1ea5 (patch)
tree75d0f6d9053dcdabeba6dcd2e714f21b80203dc3 /editors/code/src
parentef52fd543f4048d36e2c37281de4bc343871a62d (diff)
downloadrust-2734ffa20c4c38f57bb6808d6cf87d0a8aaf1ea5.tar.gz
rust-2734ffa20c4c38f57bb6808d6cf87d0a8aaf1ea5.zip
vscode: remove logging from inlays, run fix lint issues
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/inlay_hints.ts25
1 files changed, 7 insertions, 18 deletions
diff --git a/editors/code/src/inlay_hints.ts b/editors/code/src/inlay_hints.ts
index 6d084362db8..d7fabe795a1 100644
--- a/editors/code/src/inlay_hints.ts
+++ b/editors/code/src/inlay_hints.ts
@@ -3,7 +3,7 @@ import * as vscode from 'vscode';
 import * as ra from './rust-analyzer-api';
 
 import { Ctx, Disposable } from './ctx';
-import { sendRequestWithRetry, isRustDocument, RustDocument, RustEditor, log } from './util';
+import { sendRequestWithRetry, isRustDocument, RustDocument, RustEditor } from './util';
 
 
 export function activateInlayHints(ctx: Ctx) {
@@ -86,7 +86,8 @@ class HintsUpdater implements Disposable {
 
         // Set up initial cache shape
         ctx.visibleRustEditors.forEach(editor => self.sourceFiles.set(
-            editor.document.uri.toString(), {
+            editor.document.uri.toString(),
+            {
                 document: editor.document,
                 inlaysRequest: null,
                 cachedDecorations: null
@@ -104,9 +105,8 @@ class HintsUpdater implements Disposable {
         this.disposables.forEach(d => d.dispose());
     }
 
-    onDidChangeTextDocument({contentChanges, document}: vscode.TextDocumentChangeEvent) {
+    onDidChangeTextDocument({ contentChanges, document }: vscode.TextDocumentChangeEvent) {
         if (contentChanges.length === 0 || !isRustDocument(document)) return;
-        log.debug(`[inlays]: changed text doc!`);
         this.syncCacheAndRenderHints();
     }
 
@@ -126,7 +126,6 @@ class HintsUpdater implements Disposable {
     }
 
     onDidChangeVisibleTextEditors() {
-        log.debug(`[inlays]: changed visible text editors`);
         const newSourceFiles = new Map<string, RustSourceFile>();
 
         // Rerendering all, even up-to-date editors for simplicity
@@ -184,11 +183,7 @@ class HintsUpdater implements Disposable {
         return decorations;
     }
 
-    lastReqId = 0;
     private async fetchHints(file: RustSourceFile): Promise<null | ra.InlayHint[]> {
-        const reqId = ++this.lastReqId;
-
-        log.debug(`[inlays]: ${reqId} requesting`);
         file.inlaysRequest?.cancel();
 
         const tokenSource = new vscode.CancellationTokenSource();
@@ -197,18 +192,12 @@ class HintsUpdater implements Disposable {
         const request = { textDocument: { uri: file.document.uri.toString() } };
 
         return sendRequestWithRetry(this.ctx.client, ra.inlayHints, request, tokenSource.token)
-            .catch(_ => {
-                log.debug(`[inlays]: ${reqId} err`);
-                return null;
-            })
+            .catch(_ => null)
             .finally(() => {
                 if (file.inlaysRequest === tokenSource) {
                     file.inlaysRequest = null;
-                    log.debug(`[inlays]: ${reqId} got response!`);
-                } else {
-                    log.debug(`[inlays]: ${reqId} cancelled!`);
                 }
-            })
+            });
     }
 }
 
@@ -227,5 +216,5 @@ interface RustSourceFile {
     */
     cachedDecorations: null | InlaysDecorations;
 
-    document: RustDocument
+    document: RustDocument;
 }