summaryrefslogtreecommitdiff
path: root/cli/lsp/diagnostics.rs
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2022-02-24 08:01:20 +1100
committerGitHub <noreply@github.com>2022-02-24 08:01:20 +1100
commit973fe6dd3a01f518b5f8f2a766fae23b24dfdcac (patch)
treeb9bf37f59dc9c973ffde0bd02a941ee70ab81f76 /cli/lsp/diagnostics.rs
parent7122187bc7e29d972947cf6604eacca73f126449 (diff)
refactor: remove dead code from lsp (#13743)
Diffstat (limited to 'cli/lsp/diagnostics.rs')
-rw-r--r--cli/lsp/diagnostics.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs
index 420d95672..39f7f1c48 100644
--- a/cli/lsp/diagnostics.rs
+++ b/cli/lsp/diagnostics.rs
@@ -29,15 +29,11 @@ use deno_runtime::tokio_util::create_basic_runtime;
use log::error;
use lspower::lsp;
use std::collections::HashMap;
-use std::collections::HashSet;
-use std::mem;
use std::sync::Arc;
use std::thread;
use tokio::sync::mpsc;
use tokio::sync::Mutex;
-use tokio::time::sleep;
use tokio::time::Duration;
-use tokio::time::Instant;
use tokio_util::sync::CancellationToken;
pub(crate) type SnapshotForDiagnostics =
@@ -80,7 +76,7 @@ impl DiagnosticsPublisher {
// in case they're not keep track of that
let diagnostics_by_version =
all_diagnostics.entry(specifier.clone()).or_default();
- let mut version_diagnostics =
+ let version_diagnostics =
diagnostics_by_version.entry(version).or_default();
version_diagnostics.extend(diagnostics);
@@ -180,6 +176,7 @@ impl DiagnosticsServer {
self.ts_diagnostics.invalidate_all();
}
+ #[allow(unused_must_use)]
pub(crate) fn start(&mut self) {
let (tx, mut rx) = mpsc::unbounded_channel::<SnapshotForDiagnostics>();
self.channel = Some(tx);
@@ -574,7 +571,6 @@ struct DiagnosticDataSpecifier {
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct DiagnosticDataRedirect {
- pub specifier: ModuleSpecifier,
pub redirect: ModuleSpecifier,
}
@@ -1033,7 +1029,6 @@ let c: number = "a";
#[tokio::test]
async fn test_cancelled_ts_diagnostics_request() {
- let specifier = ModuleSpecifier::parse("file:///a.ts").unwrap();
let (snapshot, _) = setup(&[(
"file:///a.ts",
r#"export let a: string = 5;"#,