test: add more tests about completing in middle of strings/labels (#1052)

This commit is contained in:
Myriad-Dreamin 2024-12-22 20:15:23 +08:00 committed by GitHub
parent 8a88b50cb1
commit b7f44e882a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 117 additions and 0 deletions

View file

@ -0,0 +1,7 @@
/// path: base.typ
#let aa() = 1;
-----
#import "ba"/* range -1..0 */

View file

@ -0,0 +1,7 @@
/// path: base.typ
#let aa() = 1;
-----
#read(""/* range -1..0 */)

View file

@ -0,0 +1,7 @@
/// path: base.typ
#let aa() = 1;
-----
#read("ba"/* range -1..0 */)

View file

@ -0,0 +1,32 @@
---
source: crates/tinymist-query/src/completion.rs
description: "Completion on \" (11..12)"
expression: "JsonRepr::new_pure(results)"
input_file: crates/tinymist-query/src/fixtures/completion/import_rel_path_middle.typ
snapshot_kind: text
---
[
{
"isIncomplete": false,
"items": [
{
"kind": 17,
"label": "base.typ",
"sortText": "0",
"textEdit": {
"newText": "base.typ",
"range": {
"end": {
"character": 11,
"line": 0
},
"start": {
"character": 9,
"line": 0
}
}
}
}
]
}
]

View file

@ -0,0 +1,32 @@
---
source: crates/tinymist-query/src/completion.rs
description: "Completion on \" (7..8)"
expression: "JsonRepr::new_pure(results)"
input_file: crates/tinymist-query/src/fixtures/completion/read_path.typ
snapshot_kind: text
---
[
{
"isIncomplete": false,
"items": [
{
"kind": 17,
"label": "base.typ",
"sortText": "000",
"textEdit": {
"newText": "base.typ",
"range": {
"end": {
"character": 7,
"line": 0
},
"start": {
"character": 7,
"line": 0
}
}
}
}
]
}
]

View file

@ -0,0 +1,32 @@
---
source: crates/tinymist-query/src/completion.rs
description: "Completion on \" (9..10)"
expression: "JsonRepr::new_pure(results)"
input_file: crates/tinymist-query/src/fixtures/completion/read_path_middle.typ
snapshot_kind: text
---
[
{
"isIncomplete": false,
"items": [
{
"kind": 17,
"label": "base.typ",
"sortText": "000",
"textEdit": {
"newText": "base.typ",
"range": {
"end": {
"character": 9,
"line": 0
},
"start": {
"character": 7,
"line": 0
}
}
}
}
]
}
]