mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-03 17:58:17 +00:00
test: testcases for resource include (#1082)
This commit is contained in:
parent
98c61d0023
commit
3d805e0511
3 changed files with 52 additions and 0 deletions
11
crates/tinymist-query/src/fixtures/rename/resources.typ
Normal file
11
crates/tinymist-query/src/fixtures/rename/resources.typ
Normal file
|
@ -0,0 +1,11 @@
|
|||
/// path: lib.typ
|
||||
|
||||
-----
|
||||
|
||||
/// path: bib.yaml
|
||||
|
||||
-----
|
||||
|
||||
#import "lib.typ"
|
||||
#include /* position after */ "lib.typ"
|
||||
#bibliography("bib.yaml")
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/prepare_rename.rs
|
||||
expression: "JsonRepr::new_redacted(result, &REDACT_LOC)"
|
||||
input_file: crates/tinymist-query/src/fixtures/rename/resources.typ
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"placeholder": "lib.typ",
|
||||
"range": "1:30:1:39"
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/rename.rs
|
||||
expression: "JsonRepr::new_redacted(result, &REDACT_LOC)"
|
||||
input_file: crates/tinymist-query/src/fixtures/rename/resources.typ
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"documentChanges": [
|
||||
{
|
||||
"edits": [
|
||||
{
|
||||
"newText": "\"new_name.typ\"",
|
||||
"range": "1:30:1:39"
|
||||
},
|
||||
{
|
||||
"newText": "\"new_name.typ\" as lib",
|
||||
"range": "0:8:0:17"
|
||||
}
|
||||
],
|
||||
"textDocument": {
|
||||
"uri": "s2.typ",
|
||||
"version": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "rename",
|
||||
"newUri": "new_name.typ",
|
||||
"oldUri": "lib.typ"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue