mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-12 13:26:51 +00:00
remove assignments
This commit is contained in:
parent
1827f10be6
commit
43e6ea8054
13 changed files with 1547 additions and 28 deletions
|
@ -114,7 +114,6 @@ pub enum Block {
|
|||
tag: Tag,
|
||||
nodes: Vec<Node>,
|
||||
closing: Option<Box<Block>>,
|
||||
assignments: Option<Vec<Assignment>>,
|
||||
},
|
||||
Branch {
|
||||
tag: Tag,
|
||||
|
@ -169,7 +168,6 @@ Block::Block {
|
|||
tag: Tag, // The opening Tag of the block
|
||||
nodes: Vec<Node>, // Nodes contained within the block
|
||||
closing: Option<Box<Block>>, // Contains Block::Closing if present
|
||||
assignments: Option<Vec<Assignment>>, // Assignments declared within the tag
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -149,7 +149,6 @@ pub enum Block {
|
|||
tag: Tag,
|
||||
nodes: Vec<Node>,
|
||||
closing: Option<Box<Block>>,
|
||||
assignments: Option<Vec<Assignment>>,
|
||||
},
|
||||
Branch {
|
||||
tag: Tag,
|
||||
|
@ -193,13 +192,6 @@ impl Block {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn assignments(&self) -> Option<&Vec<Assignment>> {
|
||||
match self {
|
||||
Block::Block { assignments, .. } => assignments.as_ref(),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn template_name(&self) -> Option<&String> {
|
||||
match self {
|
||||
Block::Inclusion { template_name, .. } => Some(template_name),
|
||||
|
@ -324,7 +316,6 @@ mod tests {
|
|||
},
|
||||
nodes: vec![],
|
||||
closing: None,
|
||||
assignments: None,
|
||||
})];
|
||||
|
||||
let ast = Ast {
|
||||
|
|
|
@ -153,7 +153,6 @@ impl Parser {
|
|||
tag,
|
||||
nodes,
|
||||
closing,
|
||||
assignments: None,
|
||||
}))
|
||||
}
|
||||
|
||||
|
|
|
@ -79,6 +79,5 @@ nodes:
|
|||
start: 63
|
||||
length: 5
|
||||
assignment: ~
|
||||
assignments: ~
|
||||
line_offsets:
|
||||
- 0
|
||||
|
|
|
@ -59,6 +59,5 @@ nodes:
|
|||
start: 55
|
||||
length: 6
|
||||
assignment: ~
|
||||
assignments: ~
|
||||
line_offsets:
|
||||
- 0
|
||||
|
|
|
@ -36,6 +36,5 @@ nodes:
|
|||
start: 40
|
||||
length: 5
|
||||
assignment: ~
|
||||
assignments: ~
|
||||
line_offsets:
|
||||
- 0
|
||||
|
|
|
@ -92,7 +92,6 @@ nodes:
|
|||
start: 151
|
||||
length: 5
|
||||
assignment: ~
|
||||
assignments: ~
|
||||
- Variable:
|
||||
bits:
|
||||
- group
|
||||
|
@ -135,7 +134,6 @@ nodes:
|
|||
start: 223
|
||||
length: 5
|
||||
assignment: ~
|
||||
assignments: ~
|
||||
- Block:
|
||||
Block:
|
||||
tag:
|
||||
|
@ -169,7 +167,6 @@ nodes:
|
|||
start: 265
|
||||
length: 5
|
||||
assignment: ~
|
||||
assignments: ~
|
||||
- Block:
|
||||
Branch:
|
||||
tag:
|
||||
|
@ -202,7 +199,6 @@ nodes:
|
|||
start: 317
|
||||
length: 6
|
||||
assignment: ~
|
||||
assignments: ~
|
||||
- Block:
|
||||
Branch:
|
||||
tag:
|
||||
|
@ -235,7 +231,6 @@ nodes:
|
|||
start: 351
|
||||
length: 5
|
||||
assignment: ~
|
||||
assignments: ~
|
||||
- Text:
|
||||
content: "!"
|
||||
span:
|
||||
|
|
|
@ -56,7 +56,6 @@ nodes:
|
|||
start: 61
|
||||
length: 5
|
||||
assignment: ~
|
||||
assignments: ~
|
||||
closing:
|
||||
Closing:
|
||||
tag:
|
||||
|
@ -70,6 +69,5 @@ nodes:
|
|||
start: 72
|
||||
length: 6
|
||||
assignment: ~
|
||||
assignments: ~
|
||||
line_offsets:
|
||||
- 0
|
||||
|
|
|
@ -108,7 +108,6 @@ nodes:
|
|||
start: 323
|
||||
length: 6
|
||||
assignment: ~
|
||||
assignments: ~
|
||||
- Text:
|
||||
content: "<footer>Page Footer</footer>"
|
||||
span:
|
||||
|
@ -120,7 +119,6 @@ nodes:
|
|||
start: 366
|
||||
length: 6
|
||||
closing: ~
|
||||
assignments: ~
|
||||
line_offsets:
|
||||
- 0
|
||||
- 24
|
||||
|
|
|
@ -29,6 +29,5 @@ nodes:
|
|||
start: 26
|
||||
length: 9
|
||||
closing: ~
|
||||
assignments: ~
|
||||
line_offsets:
|
||||
- 0
|
||||
|
|
|
@ -24,6 +24,5 @@ nodes:
|
|||
start: 30
|
||||
length: 7
|
||||
closing: ~
|
||||
assignments: ~
|
||||
line_offsets:
|
||||
- 0
|
||||
|
|
|
@ -194,7 +194,6 @@ nodes:
|
|||
start: 767
|
||||
length: 5
|
||||
assignment: ~
|
||||
assignments: ~
|
||||
closing:
|
||||
Closing:
|
||||
tag:
|
||||
|
@ -208,7 +207,6 @@ nodes:
|
|||
start: 791
|
||||
length: 5
|
||||
assignment: ~
|
||||
assignments: ~
|
||||
- Text:
|
||||
content: "</div>"
|
||||
span:
|
||||
|
|
1547
crates/djls-template-ast/tagspecs/defaulttags.py
Normal file
1547
crates/djls-template-ast/tagspecs/defaulttags.py
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue