Clean up Element API and start on docs

This commit is contained in:
Nathan Sobo 2023-12-31 08:33:40 -07:00
parent 5f2bb82ef3
commit 83923fd6d5
125 changed files with 370 additions and 335 deletions

View file

@ -595,9 +595,9 @@ fn log_contents(lines: &VecDeque<String>) -> String {
}
impl Render for LspLogView {
type Element = EditorElement;
type Output = EditorElement;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Output {
self.editor.update(cx, |editor, cx| editor.render(cx))
}
}
@ -709,9 +709,9 @@ impl ToolbarItemView for LspLogToolbarItemView {
}
impl Render for LspLogToolbarItemView {
type Element = Div;
type Output = Div;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Output {
let Some(log_view) = self.log_view.clone() else {
return div();
};

View file

@ -305,9 +305,9 @@ impl SyntaxTreeView {
}
impl Render for SyntaxTreeView {
type Element = Div;
type Output = Div;
fn render(&mut self, cx: &mut gpui::ViewContext<'_, Self>) -> Self::Element {
fn render(&mut self, cx: &mut gpui::ViewContext<'_, Self>) -> Self::Output {
let settings = ThemeSettings::get_global(cx);
let line_height = cx
.text_style()
@ -507,7 +507,7 @@ fn format_node_range(node: Node) -> String {
}
impl Render for SyntaxTreeToolbarItemView {
type Element = PopoverMenu<ContextMenu>;
type Output = PopoverMenu<ContextMenu>;
fn render(&mut self, cx: &mut ViewContext<'_, Self>) -> PopoverMenu<ContextMenu> {
self.render_menu(cx)