Re-export basic text types from text and language crates
Also avoid production dependencies on fs and rope in collab
This commit is contained in:
@@ -5,9 +5,8 @@ use super::{
|
||||
use crate::{Anchor, ExcerptRange, ToPoint as _};
|
||||
use collections::{Bound, HashMap, HashSet};
|
||||
use gpui::{ElementBox, RenderContext};
|
||||
use language::{BufferSnapshot, Chunk, Patch};
|
||||
use language::{BufferSnapshot, Chunk, Patch, Point};
|
||||
use parking_lot::Mutex;
|
||||
use rope::point::Point;
|
||||
use std::{
|
||||
cell::RefCell,
|
||||
cmp::{self, Ordering},
|
||||
|
||||
@@ -5,9 +5,8 @@ use crate::{
|
||||
};
|
||||
use collections::BTreeMap;
|
||||
use gpui::fonts::HighlightStyle;
|
||||
use language::{Chunk, Edit, TextSummary};
|
||||
use language::{Chunk, Edit, Point, TextSummary};
|
||||
use parking_lot::Mutex;
|
||||
use rope::point::Point;
|
||||
use std::{
|
||||
any::TypeId,
|
||||
cmp::{self, Ordering},
|
||||
|
||||
@@ -3,10 +3,8 @@ use super::{
|
||||
TextHighlights,
|
||||
};
|
||||
use crate::MultiBufferSnapshot;
|
||||
use language::Chunk;
|
||||
use language::{Chunk, Point};
|
||||
use parking_lot::Mutex;
|
||||
use rope;
|
||||
use rope::point::Point;
|
||||
use std::{cmp, mem, num::NonZeroU32, ops::Range};
|
||||
use sum_tree::Bias;
|
||||
|
||||
@@ -372,7 +370,7 @@ pub struct TextSummary {
|
||||
|
||||
impl<'a> From<&'a str> for TextSummary {
|
||||
fn from(text: &'a str) -> Self {
|
||||
let sum = rope::TextSummary::from(text);
|
||||
let sum = text::TextSummary::from(text);
|
||||
|
||||
TextSummary {
|
||||
lines: sum.lines,
|
||||
@@ -524,7 +522,7 @@ mod tests {
|
||||
log::info!("FoldMap text: {:?}", folds_snapshot.text());
|
||||
|
||||
let (_, tabs_snapshot) = TabMap::new(folds_snapshot.clone(), tab_size);
|
||||
let text = rope::Rope::from(tabs_snapshot.text().as_str());
|
||||
let text = text::Rope::from(tabs_snapshot.text().as_str());
|
||||
log::info!(
|
||||
"TabMap text (tab size: {}): {:?}",
|
||||
tab_size,
|
||||
|
||||
@@ -8,9 +8,8 @@ use gpui::{
|
||||
fonts::FontId, text_layout::LineWrapper, Entity, ModelContext, ModelHandle, MutableAppContext,
|
||||
Task,
|
||||
};
|
||||
use language::Chunk;
|
||||
use language::{Chunk, Point};
|
||||
use lazy_static::lazy_static;
|
||||
use rope::point::Point;
|
||||
use smol::future::yield_now;
|
||||
use std::{cmp, collections::VecDeque, mem, ops::Range, time::Duration};
|
||||
use sum_tree::{Bias, Cursor, SumTree};
|
||||
|
||||
Reference in New Issue
Block a user