mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-08 11:20:37 +00:00
reorder
This commit is contained in:
parent
ad293c6b26
commit
1bf4f8390e
1 changed files with 48 additions and 48 deletions
|
@ -34,11 +34,12 @@ Enumeration of all possible node types in the AST.
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
pub enum Node {
|
pub enum Node {
|
||||||
Text {
|
Block(Block),
|
||||||
|
Comment {
|
||||||
content: String,
|
content: String,
|
||||||
span: Span,
|
span: Span,
|
||||||
},
|
},
|
||||||
Comment {
|
Text {
|
||||||
content: String,
|
content: String,
|
||||||
span: Span,
|
span: Span,
|
||||||
},
|
},
|
||||||
|
@ -47,52 +48,6 @@ pub enum Node {
|
||||||
filters: Vec<DjangoFilter>,
|
filters: Vec<DjangoFilter>,
|
||||||
span: Span,
|
span: Span,
|
||||||
},
|
},
|
||||||
Block(Block),
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `Node::Text`
|
|
||||||
|
|
||||||
Represents raw text and HTML content outside of Django template tags.
|
|
||||||
|
|
||||||
```rust
|
|
||||||
Node::Text {
|
|
||||||
content: String, // The raw text content
|
|
||||||
span: Span, // The position of the text in the template
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `Node::Comment`
|
|
||||||
|
|
||||||
Represents Django template comments (`{# ... #}`).
|
|
||||||
|
|
||||||
```rust
|
|
||||||
Node::Comment {
|
|
||||||
content: String, // The comment content
|
|
||||||
span: Span, // The position of the comment in the template
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `Node::Variable`
|
|
||||||
|
|
||||||
Represents variable interpolation (`{{ variable|filter }}`).
|
|
||||||
|
|
||||||
```rust
|
|
||||||
Node::Variable {
|
|
||||||
bits: Vec<String>, // Components of the variable path
|
|
||||||
filters: Vec<DjangoFilter>, // Filters applied to the variable
|
|
||||||
span: Span, // The position of the variable in the template
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### `DjangoFilter`
|
|
||||||
|
|
||||||
Represents a filter applied to a variable.
|
|
||||||
|
|
||||||
```rust
|
|
||||||
pub struct DjangoFilter {
|
|
||||||
pub name: String, // Name of the filter
|
|
||||||
pub args: Vec<String>, // Arguments passed to the filter
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -242,6 +197,51 @@ Examples:
|
||||||
- `{% load %}`
|
- `{% load %}`
|
||||||
- `{% now "Y-m-d" %}`
|
- `{% now "Y-m-d" %}`
|
||||||
|
|
||||||
|
#### `Node::Comment`
|
||||||
|
|
||||||
|
Represents Django template comments (`{# ... #}`).
|
||||||
|
|
||||||
|
```rust
|
||||||
|
Node::Comment {
|
||||||
|
content: String, // The comment content
|
||||||
|
span: Span, // The position of the comment in the template
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `Node::Text`
|
||||||
|
|
||||||
|
Represents raw text and HTML content outside of Django template tags.
|
||||||
|
|
||||||
|
```rust
|
||||||
|
Node::Text {
|
||||||
|
content: String, // The raw text content
|
||||||
|
span: Span, // The position of the text in the template
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `Node::Variable`
|
||||||
|
|
||||||
|
Represents variable interpolation (`{{ variable|filter }}`).
|
||||||
|
|
||||||
|
```rust
|
||||||
|
Node::Variable {
|
||||||
|
bits: Vec<String>, // Components of the variable path
|
||||||
|
filters: Vec<DjangoFilter>, // Filters applied to the variable
|
||||||
|
span: Span, // The position of the variable in the template
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
##### `DjangoFilter`
|
||||||
|
|
||||||
|
Represents a filter applied to a variable.
|
||||||
|
|
||||||
|
```rust
|
||||||
|
pub struct DjangoFilter {
|
||||||
|
pub name: String, // Name of the filter
|
||||||
|
pub args: Vec<String>, // Arguments passed to the filter
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## TagSpecs
|
## TagSpecs
|
||||||
|
|
||||||
### Schema
|
### Schema
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue