mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-12 21:36:55 +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,
|
tag: Tag,
|
||||||
nodes: Vec<Node>,
|
nodes: Vec<Node>,
|
||||||
closing: Option<Box<Block>>,
|
closing: Option<Box<Block>>,
|
||||||
assignments: Option<Vec<Assignment>>,
|
|
||||||
},
|
},
|
||||||
Branch {
|
Branch {
|
||||||
tag: Tag,
|
tag: Tag,
|
||||||
|
@ -169,7 +168,6 @@ Block::Block {
|
||||||
tag: Tag, // The opening Tag of the block
|
tag: Tag, // The opening Tag of the block
|
||||||
nodes: Vec<Node>, // Nodes contained within the block
|
nodes: Vec<Node>, // Nodes contained within the block
|
||||||
closing: Option<Box<Block>>, // Contains Block::Closing if present
|
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,
|
tag: Tag,
|
||||||
nodes: Vec<Node>,
|
nodes: Vec<Node>,
|
||||||
closing: Option<Box<Block>>,
|
closing: Option<Box<Block>>,
|
||||||
assignments: Option<Vec<Assignment>>,
|
|
||||||
},
|
},
|
||||||
Branch {
|
Branch {
|
||||||
tag: Tag,
|
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> {
|
pub fn template_name(&self) -> Option<&String> {
|
||||||
match self {
|
match self {
|
||||||
Block::Inclusion { template_name, .. } => Some(template_name),
|
Block::Inclusion { template_name, .. } => Some(template_name),
|
||||||
|
@ -324,7 +316,6 @@ mod tests {
|
||||||
},
|
},
|
||||||
nodes: vec![],
|
nodes: vec![],
|
||||||
closing: None,
|
closing: None,
|
||||||
assignments: None,
|
|
||||||
})];
|
})];
|
||||||
|
|
||||||
let ast = Ast {
|
let ast = Ast {
|
||||||
|
|
|
@ -153,7 +153,6 @@ impl Parser {
|
||||||
tag,
|
tag,
|
||||||
nodes,
|
nodes,
|
||||||
closing,
|
closing,
|
||||||
assignments: None,
|
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,5 @@ nodes:
|
||||||
start: 63
|
start: 63
|
||||||
length: 5
|
length: 5
|
||||||
assignment: ~
|
assignment: ~
|
||||||
assignments: ~
|
|
||||||
line_offsets:
|
line_offsets:
|
||||||
- 0
|
- 0
|
||||||
|
|
|
@ -59,6 +59,5 @@ nodes:
|
||||||
start: 55
|
start: 55
|
||||||
length: 6
|
length: 6
|
||||||
assignment: ~
|
assignment: ~
|
||||||
assignments: ~
|
|
||||||
line_offsets:
|
line_offsets:
|
||||||
- 0
|
- 0
|
||||||
|
|
|
@ -36,6 +36,5 @@ nodes:
|
||||||
start: 40
|
start: 40
|
||||||
length: 5
|
length: 5
|
||||||
assignment: ~
|
assignment: ~
|
||||||
assignments: ~
|
|
||||||
line_offsets:
|
line_offsets:
|
||||||
- 0
|
- 0
|
||||||
|
|
|
@ -92,7 +92,6 @@ nodes:
|
||||||
start: 151
|
start: 151
|
||||||
length: 5
|
length: 5
|
||||||
assignment: ~
|
assignment: ~
|
||||||
assignments: ~
|
|
||||||
- Variable:
|
- Variable:
|
||||||
bits:
|
bits:
|
||||||
- group
|
- group
|
||||||
|
@ -135,7 +134,6 @@ nodes:
|
||||||
start: 223
|
start: 223
|
||||||
length: 5
|
length: 5
|
||||||
assignment: ~
|
assignment: ~
|
||||||
assignments: ~
|
|
||||||
- Block:
|
- Block:
|
||||||
Block:
|
Block:
|
||||||
tag:
|
tag:
|
||||||
|
@ -169,7 +167,6 @@ nodes:
|
||||||
start: 265
|
start: 265
|
||||||
length: 5
|
length: 5
|
||||||
assignment: ~
|
assignment: ~
|
||||||
assignments: ~
|
|
||||||
- Block:
|
- Block:
|
||||||
Branch:
|
Branch:
|
||||||
tag:
|
tag:
|
||||||
|
@ -202,7 +199,6 @@ nodes:
|
||||||
start: 317
|
start: 317
|
||||||
length: 6
|
length: 6
|
||||||
assignment: ~
|
assignment: ~
|
||||||
assignments: ~
|
|
||||||
- Block:
|
- Block:
|
||||||
Branch:
|
Branch:
|
||||||
tag:
|
tag:
|
||||||
|
@ -235,7 +231,6 @@ nodes:
|
||||||
start: 351
|
start: 351
|
||||||
length: 5
|
length: 5
|
||||||
assignment: ~
|
assignment: ~
|
||||||
assignments: ~
|
|
||||||
- Text:
|
- Text:
|
||||||
content: "!"
|
content: "!"
|
||||||
span:
|
span:
|
||||||
|
|
|
@ -56,7 +56,6 @@ nodes:
|
||||||
start: 61
|
start: 61
|
||||||
length: 5
|
length: 5
|
||||||
assignment: ~
|
assignment: ~
|
||||||
assignments: ~
|
|
||||||
closing:
|
closing:
|
||||||
Closing:
|
Closing:
|
||||||
tag:
|
tag:
|
||||||
|
@ -70,6 +69,5 @@ nodes:
|
||||||
start: 72
|
start: 72
|
||||||
length: 6
|
length: 6
|
||||||
assignment: ~
|
assignment: ~
|
||||||
assignments: ~
|
|
||||||
line_offsets:
|
line_offsets:
|
||||||
- 0
|
- 0
|
||||||
|
|
|
@ -108,7 +108,6 @@ nodes:
|
||||||
start: 323
|
start: 323
|
||||||
length: 6
|
length: 6
|
||||||
assignment: ~
|
assignment: ~
|
||||||
assignments: ~
|
|
||||||
- Text:
|
- Text:
|
||||||
content: "<footer>Page Footer</footer>"
|
content: "<footer>Page Footer</footer>"
|
||||||
span:
|
span:
|
||||||
|
@ -120,7 +119,6 @@ nodes:
|
||||||
start: 366
|
start: 366
|
||||||
length: 6
|
length: 6
|
||||||
closing: ~
|
closing: ~
|
||||||
assignments: ~
|
|
||||||
line_offsets:
|
line_offsets:
|
||||||
- 0
|
- 0
|
||||||
- 24
|
- 24
|
||||||
|
|
|
@ -29,6 +29,5 @@ nodes:
|
||||||
start: 26
|
start: 26
|
||||||
length: 9
|
length: 9
|
||||||
closing: ~
|
closing: ~
|
||||||
assignments: ~
|
|
||||||
line_offsets:
|
line_offsets:
|
||||||
- 0
|
- 0
|
||||||
|
|
|
@ -24,6 +24,5 @@ nodes:
|
||||||
start: 30
|
start: 30
|
||||||
length: 7
|
length: 7
|
||||||
closing: ~
|
closing: ~
|
||||||
assignments: ~
|
|
||||||
line_offsets:
|
line_offsets:
|
||||||
- 0
|
- 0
|
||||||
|
|
|
@ -194,7 +194,6 @@ nodes:
|
||||||
start: 767
|
start: 767
|
||||||
length: 5
|
length: 5
|
||||||
assignment: ~
|
assignment: ~
|
||||||
assignments: ~
|
|
||||||
closing:
|
closing:
|
||||||
Closing:
|
Closing:
|
||||||
tag:
|
tag:
|
||||||
|
@ -208,7 +207,6 @@ nodes:
|
||||||
start: 791
|
start: 791
|
||||||
length: 5
|
length: 5
|
||||||
assignment: ~
|
assignment: ~
|
||||||
assignments: ~
|
|
||||||
- Text:
|
- Text:
|
||||||
content: "</div>"
|
content: "</div>"
|
||||||
span:
|
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