Extract outline rendering to outline crate (#20179)

This PR extracts the `render_item` implementation for outlines to the
`outline` crate to help reduce `language`'s dependence on `theme`.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-11-04 11:54:37 -05:00 committed by GitHub
parent 4bbde40267
commit 7025d3f29d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 59 additions and 54 deletions

View file

@ -24,6 +24,7 @@ gpui.workspace = true
language.workspace = true
log.workspace = true
menu.workspace = true
outline.workspace = true
project.workspace = true
schemars.workspace = true
search.workspace = true

View file

@ -1672,7 +1672,7 @@ impl OutlinePanel {
"{buffer_id:?}|{excerpt_id:?}{:?}|{:?}",
rendered_outline.range, &rendered_outline.text,
))),
language::render_item(
outline::render_item(
rendered_outline,
string_match
.map(|string_match| string_match.ranges().collect::<Vec<_>>())
@ -1911,7 +1911,7 @@ impl OutlinePanel {
} else {
&search_matches
};
let label_element = language::render_item(
let label_element = outline::render_item(
&OutlineItem {
depth,
annotation_range: None,