From 722023e3477ca82b89713267e70169ad1efd0c47 Mon Sep 17 00:00:00 2001 From: Keith Simmons Date: Thu, 9 Jun 2022 13:14:25 -0700 Subject: [PATCH] test and build fixes --- crates/editor/Cargo.toml | 2 ++ crates/editor/src/editor.rs | 7 ++----- crates/editor/src/hover_popover.rs | 2 +- crates/editor/src/test.rs | 1 + 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/editor/Cargo.toml b/crates/editor/Cargo.toml index 741dd93f33b057102dc2c73c16c926028829c302..6e1e3b09bd9b56f228b8a9c8524de5fc9d7e6fe3 100644 --- a/crates/editor/Cargo.toml +++ b/crates/editor/Cargo.toml @@ -16,6 +16,7 @@ test-support = [ "project/test-support", "util/test-support", "workspace/test-support", + "tree-sitter-rust" ] [dependencies] @@ -48,6 +49,7 @@ rand = { version = "0.8.3", optional = true } serde = { version = "1.0", features = ["derive", "rc"] } smallvec = { version = "1.6", features = ["union"] } smol = "1.2" +tree-sitter-rust = { version = "*", optional = true } [dev-dependencies] text = { path = "../text", features = ["test-support"] } diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 17fdcc49f0a4ba2b09245937338e8dc091a047a0..d13d2e3a2c73427b77f9b91a08c330b17101e834 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -43,7 +43,7 @@ pub use multi_buffer::{ ToPoint, }; use ordered_float::OrderedFloat; -use project::{HoverBlock, Project, ProjectPath, ProjectTransaction}; +use project::{Project, ProjectPath, ProjectTransaction}; use selections_collection::{resolve_multiple, MutableSelectionsCollection, SelectionsCollection}; use serde::{Deserialize, Serialize}; use settings::Settings; @@ -6148,10 +6148,7 @@ pub fn styled_runs_for_code_label<'a>( #[cfg(test)] mod tests { use crate::{ - hover_popover::{ - hover, hover_at, HoverAt, HOVER_DELAY_MILLIS, HOVER_GRACE_MILLIS, - HOVER_REQUEST_DELAY_MILLIS, - }, + hover_popover::{hover, hover_at, HoverAt, HOVER_DELAY_MILLIS, HOVER_GRACE_MILLIS}, test::{ assert_text_with_selections, build_editor, select_ranges, EditorLspTestContext, EditorTestContext, diff --git a/crates/editor/src/hover_popover.rs b/crates/editor/src/hover_popover.rs index f4b4c3414cd3ed7dbcc458c288356bb263929543..462e47e5a04f5fca49dc1bcd44ca7b8ba84eaf23 100644 --- a/crates/editor/src/hover_popover.rs +++ b/crates/editor/src/hover_popover.rs @@ -217,7 +217,7 @@ fn show_hover( this.hover_state.popover = hover_popover; cx.notify(); } else { - if this.hover_state.popover.is_some() { + if this.hover_state.visible() { // Popover was visible, but now is hidden. Dismiss it hide_hover(this, cx); } else { diff --git a/crates/editor/src/test.rs b/crates/editor/src/test.rs index 2222906cd45a5afb4ee63da602e3287d75823658..99197bb2fd07e134cc966cfa75d212bd503f1ea4 100644 --- a/crates/editor/src/test.rs +++ b/crates/editor/src/test.rs @@ -449,6 +449,7 @@ impl<'a> EditorLspTestContext<'a> { } } + #[cfg(feature = "test-support")] pub async fn new_rust( capabilities: lsp::ServerCapabilities, cx: &'a mut gpui::TestAppContext,