mirror of
https://github.com/zed-industries/zed.git
synced 2026-08-26 17:42:21 +00:00
Adds a narrow `benchmarks` feature to `multi_buffer`, gating `MultiBuffer::build_simple_for_benchmarks`/`build_random_for_benchmarks` as production-faithful equivalents of `build_simple`/`build_random` that do not require any crate's test-support. `display_map`/`editor_render` now call the new functions instead, and `benchmarks` requests `multi_buffer/benchmarks` instead of `multi_buffer/test-support`. `build_random_for_benchmarks` is a dedicated duplicate of `randomly_edit_excerpts`, substituting a vendored `BenchmarkRandomCharIter` for `util::RandomCharIter` (the only test-support-only dependency it has), guarded against drift by a new parity test asserting byte-identical output against `build_random` for the same rng sequence. Extends script/check-gpui-bench-feature-isolation to prove the direct benchmarks -> multi_buffer/test-support edge is gone and that multi_buffer's benchmarks feature itself resolves no test-support.
69 lines
1.9 KiB
TOML
69 lines
1.9 KiB
TOML
[package]
|
|
name = "multi_buffer"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
publish.workspace = true
|
|
license = "GPL-3.0-or-later"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[lib]
|
|
path = "src/multi_buffer.rs"
|
|
doctest = false
|
|
|
|
[features]
|
|
# Gates `MultiBuffer::build_simple_for_benchmarks`/`build_random_for_benchmarks`,
|
|
# production-faithful equivalents of `build_simple`/`build_random` for
|
|
# production-rendering benchmarks (`crates/benchmarks`). Deliberately empty:
|
|
# unlike `test-support`, this must not enable any dependency's test-only
|
|
# surface, so `benchmarks` consumers keep compiling production code only.
|
|
benchmarks = []
|
|
test-support = [
|
|
"buffer_diff/test-support",
|
|
"gpui/test-support",
|
|
"language/test-support",
|
|
"text/test-support",
|
|
"util/test-support",
|
|
]
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
clock.workspace = true
|
|
collections.workspace = true
|
|
ctor.workspace = true
|
|
futures-lite.workspace = true
|
|
buffer_diff.workspace = true
|
|
gpui.workspace = true
|
|
itertools.workspace = true
|
|
language.workspace = true
|
|
log.workspace = true
|
|
parking_lot.workspace = true
|
|
rand.workspace = true
|
|
rope.workspace = true
|
|
settings.workspace = true
|
|
serde.workspace = true
|
|
smallvec.workspace = true
|
|
sum_tree.workspace = true
|
|
text.workspace = true
|
|
theme.workspace = true
|
|
tree-sitter = { workspace = true, features = ["wasm"] }
|
|
ztracing.workspace = true
|
|
tracing.workspace = true
|
|
util.workspace = true
|
|
unicode-segmentation.workspace = true
|
|
|
|
[dev-dependencies]
|
|
buffer_diff = { workspace = true, features = ["test-support"] }
|
|
gpui = { workspace = true, features = ["test-support"] }
|
|
indoc.workspace = true
|
|
language = { workspace = true, features = ["test-support"] }
|
|
pretty_assertions.workspace = true
|
|
rand.workspace = true
|
|
settings = { workspace = true, features = ["test-support"] }
|
|
text = { workspace = true, features = ["test-support"] }
|
|
util = { workspace = true, features = ["test-support"] }
|
|
zlog.workspace = true
|
|
|
|
[package.metadata.cargo-shear]
|
|
ignored = ["tracing"]
|