We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f80396 commit 0d9cdb8Copy full SHA for 0d9cdb8
2 files changed
crates/project_graph/src/stage/structs.rs
@@ -68,6 +68,7 @@ impl EntityTrait for Text {
68
}
69
70
71
+#[derive(knus::Decode)]
72
#[enum_dispatch(EntityTrait)]
73
pub enum Entity {
74
Text(Text),
crates/project_graph/src/terminal.rs
@@ -1,4 +1,7 @@
1
-use crate::stage::{Stage, structs::Text};
+use crate::stage::{
2
+ Stage,
3
+ structs::{Entity, Text},
4
+};
5
6
pub struct Terminal {
7
input: String,
@@ -16,7 +19,7 @@ impl Terminal {
16
19
ui.separator();
17
20
ui.text_edit_multiline(&mut self.input);
18
21
if ui.button("execute").clicked() {
- match knus::parse::<Vec<Text>>("terminal_input.kdl", &self.input) {
22
+ match knus::parse::<Vec<Entity>>("terminal_input.kdl", &self.input) {
23
Ok(doc) => {
24
for entity in doc {
25
stage.context.add(entity.into());
0 commit comments