Start on a new project_symbols crate

This commit is contained in:
Antonio Scandurra 2022-02-22 08:42:12 +01:00
parent 882756d467
commit 8f375a5026
6 changed files with 294 additions and 2 deletions

View file

@ -10,8 +10,8 @@ use collections::{hash_map, HashMap, HashSet};
use futures::{future::Shared, Future, FutureExt};
use fuzzy::{PathMatch, PathMatchCandidate, PathMatchCandidateSet};
use gpui::{
AppContext, AsyncAppContext, Entity, ModelContext, ModelHandle, MutableAppContext, Task,
UpgradeModelHandle, WeakModelHandle,
fonts::HighlightStyle, AppContext, AsyncAppContext, Entity, ModelContext, ModelHandle,
MutableAppContext, Task, UpgradeModelHandle, WeakModelHandle,
};
use language::{
range_from_lsp, Anchor, AnchorRangeExt, Bias, Buffer, CodeAction, Completion, CompletionLabel,
@ -118,6 +118,11 @@ pub struct Definition {
pub target_range: Range<language::Anchor>,
}
pub struct ProjectSymbol {
pub text: String,
pub highlight_ranges: Vec<(Range<usize>, HighlightStyle)>,
}
#[derive(Default)]
pub struct ProjectTransaction(pub HashMap<ModelHandle<Buffer>, language::Transaction>);