Skip to content

Commit 96826ef

Browse files
committed
Update snapshots
1 parent c311330 commit 96826ef

14 files changed

+126
-218
lines changed

codegen-sdk-cst-generator/src/generator/snapshots/codegen_sdk_cst_generator__generator__node__tests__get_struct_tokens_complex.snap

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ pub struct TestNode<'db> {
88
file_id: FileNodeId<'db>,
99
start_byte: usize,
1010
end_byte: usize,
11-
_kind: std::string::String,
1211
start_position: Point<'db>,
1312
end_position: Point<'db>,
1413
#[debug(ignore)]
1514
buffer: Arc<Bytes>,
16-
kind_id: u16,
1715
is_error: bool,
18-
named: bool,
1916
pub multiple_field: Vec<indextree::NodeId>,
2017
pub optional_field: Option<indextree::NodeId>,
2118
pub required_field: indextree::NodeId,
@@ -52,13 +49,10 @@ impl<'db> FromNode<'db, NodeTypes<'db>> for TestNode<'db> {
5249
Self {
5350
start_byte: node.start_byte(),
5451
end_byte: node.end_byte(),
55-
_kind: node.kind().to_string(),
5652
start_position: start_position,
5753
end_position: end_position,
5854
buffer: context.buffer.clone(),
59-
kind_id: node.kind_id(),
6055
is_error: node.is_error(),
61-
named: node.is_named(),
6256
id,
6357
file_id: context.file_id.clone(),
6458
multiple_field,
@@ -70,6 +64,7 @@ impl<'db> FromNode<'db, NodeTypes<'db>> for TestNode<'db> {
7064
}
7165
}
7266
impl<'db> TestNode<'db> {
67+
const KIND_NAME: &'static str = "test_node";
7368
pub fn multiple_field(
7469
&self,
7570
tree: &'db Tree<NodeTypes<'db>>,
@@ -95,7 +90,7 @@ impl<'db> TestNode<'db> {
9590
}
9691
impl<'db> CSTNode<'db> for TestNode<'db> {
9792
fn kind_name(&self) -> &str {
98-
&self._kind
93+
&Self::KIND_NAME
9994
}
10095
fn start_byte(&self) -> usize {
10196
self.start_byte
@@ -113,13 +108,13 @@ impl<'db> CSTNode<'db> for TestNode<'db> {
113108
&self.buffer
114109
}
115110
fn kind_id(&self) -> u16 {
116-
self.kind_id
111+
0u16
117112
}
118113
fn is_error(&self) -> bool {
119114
self.is_error
120115
}
121116
fn is_named(&self) -> bool {
122-
self.named
117+
true
123118
}
124119
fn id(&self) -> CSTNodeId<'db> {
125120
self.id

codegen-sdk-cst-generator/src/generator/snapshots/codegen_sdk_cst_generator__generator__node__tests__get_struct_tokens_simple.snap

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ pub struct TestNode<'db> {
88
file_id: FileNodeId<'db>,
99
start_byte: usize,
1010
end_byte: usize,
11-
_kind: std::string::String,
1211
start_position: Point<'db>,
1312
end_position: Point<'db>,
1413
#[debug(ignore)]
1514
buffer: Arc<Bytes>,
16-
kind_id: u16,
1715
is_error: bool,
18-
named: bool,
1916
}
2017
impl<'db> FromNode<'db, NodeTypes<'db>> for TestNode<'db> {
2118
fn from_node(
@@ -30,24 +27,23 @@ impl<'db> FromNode<'db, NodeTypes<'db>> for TestNode<'db> {
3027
Self {
3128
start_byte: node.start_byte(),
3229
end_byte: node.end_byte(),
33-
_kind: node.kind().to_string(),
3430
start_position: start_position,
3531
end_position: end_position,
3632
buffer: context.buffer.clone(),
37-
kind_id: node.kind_id(),
3833
is_error: node.is_error(),
39-
named: node.is_named(),
4034
id,
4135
file_id: context.file_id.clone(),
4236
},
4337
ids,
4438
))
4539
}
4640
}
47-
impl<'db> TestNode<'db> {}
41+
impl<'db> TestNode<'db> {
42+
const KIND_NAME: &'static str = "test_node";
43+
}
4844
impl<'db> CSTNode<'db> for TestNode<'db> {
4945
fn kind_name(&self) -> &str {
50-
&self._kind
46+
&Self::KIND_NAME
5147
}
5248
fn start_byte(&self) -> usize {
5349
self.start_byte
@@ -65,13 +61,13 @@ impl<'db> CSTNode<'db> for TestNode<'db> {
6561
&self.buffer
6662
}
6763
fn kind_id(&self) -> u16 {
68-
self.kind_id
64+
0u16
6965
}
7066
fn is_error(&self) -> bool {
7167
self.is_error
7268
}
7369
fn is_named(&self) -> bool {
74-
self.named
70+
true
7571
}
7672
fn id(&self) -> CSTNodeId<'db> {
7773
self.id

codegen-sdk-cst-generator/src/generator/snapshots/codegen_sdk_cst_generator__generator__node__tests__get_struct_tokens_with_children.snap

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ pub struct TestNode<'db> {
88
file_id: FileNodeId<'db>,
99
start_byte: usize,
1010
end_byte: usize,
11-
_kind: std::string::String,
1211
start_position: Point<'db>,
1312
end_position: Point<'db>,
1413
#[debug(ignore)]
1514
buffer: Arc<Bytes>,
16-
kind_id: u16,
1715
is_error: bool,
18-
named: bool,
1916
pub _children: Vec<indextree::NodeId>,
2017
}
2118
impl<'db> FromNode<'db, NodeTypes<'db>> for TestNode<'db> {
@@ -38,13 +35,10 @@ impl<'db> FromNode<'db, NodeTypes<'db>> for TestNode<'db> {
3835
Self {
3936
start_byte: node.start_byte(),
4037
end_byte: node.end_byte(),
41-
_kind: node.kind().to_string(),
4238
start_position: start_position,
4339
end_position: end_position,
4440
buffer: context.buffer.clone(),
45-
kind_id: node.kind_id(),
4641
is_error: node.is_error(),
47-
named: node.is_named(),
4842
id,
4943
file_id: context.file_id.clone(),
5044
_children,
@@ -53,10 +47,12 @@ impl<'db> FromNode<'db, NodeTypes<'db>> for TestNode<'db> {
5347
))
5448
}
5549
}
56-
impl<'db> TestNode<'db> {}
50+
impl<'db> TestNode<'db> {
51+
const KIND_NAME: &'static str = "test_node";
52+
}
5753
impl<'db> CSTNode<'db> for TestNode<'db> {
5854
fn kind_name(&self) -> &str {
59-
&self._kind
55+
&Self::KIND_NAME
6056
}
6157
fn start_byte(&self) -> usize {
6258
self.start_byte
@@ -74,13 +70,13 @@ impl<'db> CSTNode<'db> for TestNode<'db> {
7470
&self.buffer
7571
}
7672
fn kind_id(&self) -> u16 {
77-
self.kind_id
73+
0u16
7874
}
7975
fn is_error(&self) -> bool {
8076
self.is_error
8177
}
8278
fn is_named(&self) -> bool {
83-
self.named
79+
true
8480
}
8581
fn id(&self) -> CSTNodeId<'db> {
8682
self.id

codegen-sdk-cst-generator/src/generator/snapshots/codegen_sdk_cst_generator__generator__node__tests__get_struct_tokens_with_fields.snap

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ pub struct TestNode<'db> {
88
file_id: FileNodeId<'db>,
99
start_byte: usize,
1010
end_byte: usize,
11-
_kind: std::string::String,
1211
start_position: Point<'db>,
1312
end_position: Point<'db>,
1413
#[debug(ignore)]
1514
buffer: Arc<Bytes>,
16-
kind_id: u16,
1715
is_error: bool,
18-
named: bool,
1916
pub test_field: indextree::NodeId,
2017
}
2118
impl<'db> FromNode<'db, NodeTypes<'db>> for TestNode<'db> {
@@ -36,13 +33,10 @@ impl<'db> FromNode<'db, NodeTypes<'db>> for TestNode<'db> {
3633
Self {
3734
start_byte: node.start_byte(),
3835
end_byte: node.end_byte(),
39-
_kind: node.kind().to_string(),
4036
start_position: start_position,
4137
end_position: end_position,
4238
buffer: context.buffer.clone(),
43-
kind_id: node.kind_id(),
4439
is_error: node.is_error(),
45-
named: node.is_named(),
4640
id,
4741
file_id: context.file_id.clone(),
4842
test_field,
@@ -52,13 +46,14 @@ impl<'db> FromNode<'db, NodeTypes<'db>> for TestNode<'db> {
5246
}
5347
}
5448
impl<'db> TestNode<'db> {
49+
const KIND_NAME: &'static str = "test_node";
5550
pub fn test_field(&self, tree: &'db Tree<NodeTypes<'db>>) -> &TestType<'db> {
5651
tree.get(&self.test_field).unwrap().as_ref().try_into().unwrap()
5752
}
5853
}
5954
impl<'db> CSTNode<'db> for TestNode<'db> {
6055
fn kind_name(&self) -> &str {
61-
&self._kind
56+
&Self::KIND_NAME
6257
}
6358
fn start_byte(&self) -> usize {
6459
self.start_byte
@@ -76,13 +71,13 @@ impl<'db> CSTNode<'db> for TestNode<'db> {
7671
&self.buffer
7772
}
7873
fn kind_id(&self) -> u16 {
79-
self.kind_id
74+
0u16
8075
}
8176
fn is_error(&self) -> bool {
8277
self.is_error
8378
}
8479
fn is_named(&self) -> bool {
85-
self.named
80+
true
8681
}
8782
fn id(&self) -> CSTNodeId<'db> {
8883
self.id

codegen-sdk-cst-generator/src/generator/snapshots/codegen_sdk_cst_generator__generator__node__tests__get_struct_tokens_with_single_child_type.snap

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ pub struct TestNode<'db> {
88
file_id: FileNodeId<'db>,
99
start_byte: usize,
1010
end_byte: usize,
11-
_kind: std::string::String,
1211
start_position: Point<'db>,
1312
end_position: Point<'db>,
1413
#[debug(ignore)]
1514
buffer: Arc<Bytes>,
16-
kind_id: u16,
1715
is_error: bool,
18-
named: bool,
1916
pub _children: Vec<indextree::NodeId>,
2017
}
2118
impl<'db> FromNode<'db, NodeTypes<'db>> for TestNode<'db> {
@@ -38,13 +35,10 @@ impl<'db> FromNode<'db, NodeTypes<'db>> for TestNode<'db> {
3835
Self {
3936
start_byte: node.start_byte(),
4037
end_byte: node.end_byte(),
41-
_kind: node.kind().to_string(),
4238
start_position: start_position,
4339
end_position: end_position,
4440
buffer: context.buffer.clone(),
45-
kind_id: node.kind_id(),
4641
is_error: node.is_error(),
47-
named: node.is_named(),
4842
id,
4943
file_id: context.file_id.clone(),
5044
_children,
@@ -53,10 +47,12 @@ impl<'db> FromNode<'db, NodeTypes<'db>> for TestNode<'db> {
5347
))
5448
}
5549
}
56-
impl<'db> TestNode<'db> {}
50+
impl<'db> TestNode<'db> {
51+
const KIND_NAME: &'static str = "test_node";
52+
}
5753
impl<'db> CSTNode<'db> for TestNode<'db> {
5854
fn kind_name(&self) -> &str {
59-
&self._kind
55+
&Self::KIND_NAME
6056
}
6157
fn start_byte(&self) -> usize {
6258
self.start_byte
@@ -74,13 +70,13 @@ impl<'db> CSTNode<'db> for TestNode<'db> {
7470
&self.buffer
7571
}
7672
fn kind_id(&self) -> u16 {
77-
self.kind_id
73+
0u16
7874
}
7975
fn is_error(&self) -> bool {
8076
self.is_error
8177
}
8278
fn is_named(&self) -> bool {
83-
self.named
79+
true
8480
}
8581
fn id(&self) -> CSTNodeId<'db> {
8682
self.id

codegen-sdk-cst-generator/src/generator/snapshots/codegen_sdk_cst_generator__generator__node__tests__get_trait_implementations.snap

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
source: codegen-sdk-cst-generator/src/generator/node.rs
33
expression: "snapshot_tokens(&node.get_trait_implementations(&HashSet::new()))"
44
---
5-
impl<'db> TestNode<'db> {}
5+
impl<'db> TestNode<'db> {
6+
const KIND_NAME: &'static str = "test_node";
7+
}
68
impl<'db> CSTNode<'db> for TestNode<'db> {
79
fn kind_name(&self) -> &str {
8-
&self._kind
10+
&Self::KIND_NAME
911
}
1012
fn start_byte(&self) -> usize {
1113
self.start_byte
@@ -23,13 +25,13 @@ impl<'db> CSTNode<'db> for TestNode<'db> {
2325
&self.buffer
2426
}
2527
fn kind_id(&self) -> u16 {
26-
self.kind_id
28+
0u16
2729
}
2830
fn is_error(&self) -> bool {
2931
self.is_error
3032
}
3133
fn is_named(&self) -> bool {
32-
self.named
34+
true
3335
}
3436
fn id(&self) -> CSTNodeId<'db> {
3537
self.id

0 commit comments

Comments
 (0)