CodeView builder
Read-only code with a gutter.
A builder is RenderOnce. Construct and mount it in one expression.
use gpui_kit::content::CodeView;
Construct
new(ident: impl Into<Ident>, lines: impl IntoIterator<Item = CodeLine>) -> Self
from_text(ident: impl Into<Ident>, text: &str) -> SelfOptions
Chain onto the value.
language(language: impl Into<SharedString>) -> Self
line_numbers(line_numbers: bool) -> Self
visible_lines(lines: usize) -> Self
copyable(copyable: bool) -> SelfQueries
Only answer; they change nothing.
text() -> StringRendered by
Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.