mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-04 02:08:17 +00:00
test: add test about path completion (#972)
This commit is contained in:
parent
969cc6d339
commit
f665d7c50c
5 changed files with 75 additions and 1 deletions
|
@ -0,0 +1,6 @@
|
|||
/// path: base.typ
|
||||
#let aa() = 1;
|
||||
|
||||
-----
|
||||
#import ""/* range -1..0 */
|
||||
|
|
@ -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/import_rel_path.typ
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"isIncomplete": false,
|
||||
"items": [
|
||||
{
|
||||
"kind": 17,
|
||||
"label": "base.typ",
|
||||
"sortText": "0",
|
||||
"textEdit": {
|
||||
"newText": "base.typ",
|
||||
"range": {
|
||||
"end": {
|
||||
"character": 9,
|
||||
"line": 0
|
||||
},
|
||||
"start": {
|
||||
"character": 9,
|
||||
"line": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/completion.rs
|
||||
description: "Completion on \" (30..31)"
|
||||
expression: "JsonRepr::new_pure(results)"
|
||||
input_file: crates/tinymist-query/src/fixtures/completion/string_path.typ
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"isIncomplete": false,
|
||||
"items": [
|
||||
{
|
||||
"kind": 17,
|
||||
"label": "base.typ",
|
||||
"sortText": "000",
|
||||
"textEdit": {
|
||||
"newText": "base.typ",
|
||||
"range": {
|
||||
"end": {
|
||||
"character": 7,
|
||||
"line": 1
|
||||
},
|
||||
"start": {
|
||||
"character": 7,
|
||||
"line": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
|
@ -0,0 +1,4 @@
|
|||
/// path:base.typ
|
||||
-----
|
||||
/// contains: base.typ
|
||||
#read(""/* range -1..0 */)
|
|
@ -93,7 +93,7 @@ pub fn run_with_ctx<T>(
|
|||
Some("example package (mock).".into()),
|
||||
)]
|
||||
});
|
||||
ctx.test_completion_files(Vec::new);
|
||||
ctx.test_completion_files(|| paths.clone());
|
||||
ctx.test_files(|| paths);
|
||||
f(&mut ctx, p)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue