gpui-kit GitHub

Components

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) -> Self

Options

Chain onto the value.

language(language: impl Into<SharedString>) -> Self
line_numbers(line_numbers: bool) -> Self
visible_lines(lines: usize) -> Self
copyable(copyable: bool) -> Self

Queries

Only answer; they change nothing.

text() -> String

Rendered by

Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.

Source: crates/gpui-kit/src/content/code_view.rs