mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-03 17:58:17 +00:00
test: cover cases about completing after the dot operator (#1017)
* test: add field tests * dev: add a snapshot
This commit is contained in:
parent
c0c6503f17
commit
e116b0b645
13 changed files with 164 additions and 0 deletions
|
@ -0,0 +1,5 @@
|
|||
/// contains: odd
|
||||
|
||||
#{
|
||||
calc./* range 0..1 */
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
/// contains: odd
|
||||
|
||||
#{
|
||||
calc. /* range 0..1 */
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
/// contains: odd
|
||||
|
||||
#calc./* range 0..1 */
|
|
@ -0,0 +1,3 @@
|
|||
/// contains: odd
|
||||
|
||||
#calc.o/* range 0..1 */
|
|
@ -0,0 +1,3 @@
|
|||
/// contains: odd
|
||||
|
||||
#calc. /* range 0..1 */
|
|
@ -0,0 +1,3 @@
|
|||
/// contains: odd
|
||||
|
||||
#calc.o /* range 0..1 */
|
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/completion.rs
|
||||
description: Completion on / (29..30)
|
||||
expression: "JsonRepr::new_pure(results)"
|
||||
input_file: crates/tinymist-query/src/fixtures/completion/field_code.typ
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"isIncomplete": false,
|
||||
"items": [
|
||||
{
|
||||
"kind": 3,
|
||||
"label": "odd",
|
||||
"textEdit": {
|
||||
"newText": "odd(${1:})",
|
||||
"range": {
|
||||
"end": {
|
||||
"character": 7,
|
||||
"line": 3
|
||||
},
|
||||
"start": {
|
||||
"character": 7,
|
||||
"line": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/completion.rs
|
||||
description: Completion on (31..32)
|
||||
expression: "JsonRepr::new_pure(results)"
|
||||
input_file: crates/tinymist-query/src/fixtures/completion/field_code2.typ
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"isIncomplete": false,
|
||||
"items": []
|
||||
}
|
||||
]
|
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/completion.rs
|
||||
description: Completion on / (25..26)
|
||||
expression: "JsonRepr::new_pure(results)"
|
||||
input_file: crates/tinymist-query/src/fixtures/completion/field_markup.typ
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"isIncomplete": false,
|
||||
"items": [
|
||||
{
|
||||
"kind": 3,
|
||||
"label": "odd",
|
||||
"textEdit": {
|
||||
"newText": "odd(${1:})",
|
||||
"range": {
|
||||
"end": {
|
||||
"character": 6,
|
||||
"line": 2
|
||||
},
|
||||
"start": {
|
||||
"character": 6,
|
||||
"line": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/completion.rs
|
||||
description: Completion on / (26..27)
|
||||
expression: "JsonRepr::new_pure(results)"
|
||||
input_file: crates/tinymist-query/src/fixtures/completion/field_markup2.typ
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"isIncomplete": false,
|
||||
"items": [
|
||||
{
|
||||
"kind": 3,
|
||||
"label": "odd",
|
||||
"textEdit": {
|
||||
"newText": "odd(${1:})",
|
||||
"range": {
|
||||
"end": {
|
||||
"character": 7,
|
||||
"line": 2
|
||||
},
|
||||
"start": {
|
||||
"character": 6,
|
||||
"line": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/completion.rs
|
||||
description: Completion on / (26..27)
|
||||
expression: "JsonRepr::new_pure(results)"
|
||||
input_file: crates/tinymist-query/src/fixtures/completion/field_markup3.typ
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"isIncomplete": false,
|
||||
"items": []
|
||||
}
|
||||
]
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/completion.rs
|
||||
description: Completion on / (27..28)
|
||||
expression: "JsonRepr::new_pure(results)"
|
||||
input_file: crates/tinymist-query/src/fixtures/completion/field_markup4.typ
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"isIncomplete": false,
|
||||
"items": []
|
||||
}
|
||||
]
|
|
@ -930,6 +930,16 @@ Text
|
|||
#let f(x);
|
||||
nnnnv v
|
||||
");
|
||||
assert_snapshot!(map_deref(r#"#{
|
||||
calc.
|
||||
}"#).trim(), @r"
|
||||
#{
|
||||
n
|
||||
calc.
|
||||
nnvvvvvnn
|
||||
}
|
||||
n
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue