DB & Dev Tools · Data formats: YAML lists at their key's indent, XML entities

YAML reads a list written at its key's own indent, as manifests do, and
a list at a map's indent ends at the next key. A `#` inside a quoted
scalar is no comment. XML reads entity references in text and
attributes, failing on one it does not know, and a text's path counts
text nodes from one. A tree's note takes at most half its row, cut with
an ellipsis, so a long value or attribute leaves the key its name.
Format and Minify fail loud if pressed while the JSON does not read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-09-27 09:42:03 -04:00
1 parent 1c01adc4d6
commit a0984e80a3
8 files changed
+204 -40

No files matched your search

+21 -1
View File
@@ -1,4 +1,7 @@
use gpui::{AnyElement, App, AppContext as _, Entity, IntoElement, TestAppContext, Window, div};
use gpui::{
AnyElement, App, AppContext as _, Entity, Focusable as _, IntoElement, TestAppContext, Window,
div,
};
use super::{Bench, bench, settle, tab, tap};
use crate::{
@@ -61,3 +64,20 @@ fn format_indents_the_json_and_minify_folds_it(cx: &mut TestAppContext) {
r#"{"a":[1,2]}"#
);
}
/// Stops: the editor alone, the buttons resting while the JSON does not read.
#[gpui::test]
fn format_and_minify_rest_while_the_json_does_not_read(cx: &mut TestAppContext) {
let (host, cx) = bench(editor, cx);
let editor = cx.update(|window, cx| cx.new(|cx| CodeEditor::new("{", window, cx)));
host.update(cx, |bench, cx| {
bench.editor = Some(editor.clone());
cx.notify();
});
settle(cx);
tab(1, cx);
assert!(
cx.update(|window, cx| editor.focus_handle(cx).is_focused(window)),
"Tab passes Format and Minify"
);
}