From a3174be565646675e4ccdae461d8eb148a184d60 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Wed, 28 Feb 2024 12:41:31 +0100 Subject: [PATCH] chore: Move Location type to language (#8527) Release Notes: - N/A --- crates/language/src/language.rs | 8 +++++++- crates/project/src/project.rs | 7 +------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/language/src/language.rs b/crates/language/src/language.rs index 668f038fb8..0b884803a9 100644 --- a/crates/language/src/language.rs +++ b/crates/language/src/language.rs @@ -22,7 +22,7 @@ pub mod markdown; use anyhow::{anyhow, Context, Result}; use async_trait::async_trait; use collections::{HashMap, HashSet}; -use gpui::{AppContext, AsyncAppContext, Task}; +use gpui::{AppContext, AsyncAppContext, Model, Task}; pub use highlight_map::HighlightMap; use lazy_static::lazy_static; use lsp::{CodeActionKind, LanguageServerBinary}; @@ -108,6 +108,12 @@ pub trait ToLspPosition { /// A name of a language server. #[derive(Clone, Debug, PartialEq, Eq, Hash)] pub struct LanguageServerName(pub Arc); +#[derive(Debug, Clone, PartialEq, Eq, Hash)] + +pub struct Location { + pub buffer: Model, + pub range: Range, +} /// Represents a Language Server, with certain cached sync properties. /// Uses [`LspAdapter`] under the hood, but calls all 'static' methods diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 1ee04eb628..aed89ef241 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -90,6 +90,7 @@ use util::{ }; pub use fs::*; +pub use language::Location; #[cfg(any(test, feature = "test-support"))] pub use prettier::FORMAT_SUFFIX as TEST_PRETTIER_FORMAT_SUFFIX; pub use project_core::project_settings; @@ -315,12 +316,6 @@ pub struct ProjectPath { pub path: Arc, } -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct Location { - pub buffer: Model, - pub range: Range, -} - #[derive(Debug, Clone, PartialEq, Eq)] pub struct InlayHint { pub position: language::Anchor,