DB & Dev Tools · Data formats: JSON, YAML and XML as trees, a JSON editor
A document reads into one value, Datum: JSON through serde_json, its keys now kept in their written order, and YAML's block style through a small reader that says which line it could not read. JsonViewer and YamlViewer draw it as one tree: each key with its value, maps and lists with their counts; a search keeps what holds its words and opens the way; Enter on a value copies its JSONPath. XmlViewer reads elements, attributes and text and says where tags cross. JsonEditor writes JSON in the code editor with Format and Minify and says whether it reads. DocumentViewer is JsonViewer.
This commit is contained in:
1 parent
08c8ebf386
commit
86a8b4a958
11 files changed
+1099
-8
No files matched your search
@@ -4,14 +4,17 @@ use gpui::{
|
||||
};
|
||||
|
||||
use super::{Connection, ConnectionForm, ConnectionManager, Engine, Field, TableStructureEditor};
|
||||
use crate::{forms, primitives::FocusNext, theme::Theme};
|
||||
use crate::{editor::CodeEditor, forms, primitives::FocusNext, theme::Theme};
|
||||
|
||||
mod formats;
|
||||
|
||||
type Part = fn(&Bench, &mut Window, &mut App, Entity<Bench>) -> AnyElement;
|
||||
|
||||
/// A view that shows one tool, keeps the words it heard, and holds a choice among its part's cases.
|
||||
/// A view that shows one tool, keeps the words it heard, and holds what a test hands its part: an editor, and a choice among the part's cases.
|
||||
struct Bench {
|
||||
part: Part,
|
||||
said: Vec<String>,
|
||||
editor: Option<Entity<CodeEditor>>,
|
||||
choice: usize,
|
||||
}
|
||||
|
||||
@@ -41,6 +44,7 @@ fn bench(part: Part, cx: &mut TestAppContext) -> (Entity<Bench>, &mut VisualTest
|
||||
let (host, cx) = cx.add_window_view(|_, _| Bench {
|
||||
part,
|
||||
said: Vec::new(),
|
||||
editor: None,
|
||||
choice: 0,
|
||||
});
|
||||
settle(cx);
|
||||
|
||||
Reference in new issue
Block a user