mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-25 05:22:52 +00:00
test: cases about completing field access in function call (#958)
This commit is contained in:
parent
5f8a11bdc0
commit
c0c6503f17
10 changed files with 152 additions and 0 deletions
|
|
@ -0,0 +1,5 @@
|
||||||
|
/// contains: text
|
||||||
|
|
||||||
|
#show regex(":\S+:"): it => it./* range 0..1 */
|
||||||
|
|
||||||
|
:test:
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
/// contains: text, mode
|
||||||
|
|
||||||
|
#show regex(":\S+:"): it => eval("emoji." + /* range after 3..4 */it..slice(1, it.text.len() - 1))
|
||||||
|
|
||||||
|
:cat: :anger:
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
/// contains: text, mode
|
||||||
|
|
||||||
|
#show regex(":\S+:"): it => eval("emoji." + /* range after 5..6 */ it.te.slice(1, it.text.len() - 1))
|
||||||
|
|
||||||
|
:cat: :anger:
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
/// contains: text, mode
|
||||||
|
|
||||||
|
#show regex(":\S+:"): it => eval("emoji." + /* range after 3..4 */it..at)
|
||||||
|
|
||||||
|
:cat: :anger:
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
/// contains: text, mode
|
||||||
|
|
||||||
|
#show regex(":\S+:"): it => eval("emoji." + /* range after 3..4 */it.)
|
||||||
|
|
||||||
|
:cat: :anger:
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
source: crates/tinymist-query/src/completion.rs
|
||||||
|
description: Completion on / (55..56)
|
||||||
|
expression: "JsonRepr::new_pure(results)"
|
||||||
|
input_file: crates/tinymist-query/src/fixtures/completion/field_simple.typ
|
||||||
|
snapshot_kind: text
|
||||||
|
---
|
||||||
|
[
|
||||||
|
null
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
---
|
||||||
|
source: crates/tinymist-query/src/completion.rs
|
||||||
|
description: Completion on . (95..96)
|
||||||
|
expression: "JsonRepr::new_pure(results)"
|
||||||
|
input_file: crates/tinymist-query/src/fixtures/completion/func_pos_arg_field_call.typ
|
||||||
|
snapshot_kind: text
|
||||||
|
---
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"isIncomplete": false,
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"kind": 5,
|
||||||
|
"label": "mode",
|
||||||
|
"labelDetails": {
|
||||||
|
"description": "\"code\" | \"markup\" | \"math\""
|
||||||
|
},
|
||||||
|
"sortText": "000",
|
||||||
|
"textEdit": {
|
||||||
|
"newText": "mode: ${1:}",
|
||||||
|
"range": {
|
||||||
|
"end": {
|
||||||
|
"character": 69,
|
||||||
|
"line": 2
|
||||||
|
},
|
||||||
|
"start": {
|
||||||
|
"character": 69,
|
||||||
|
"line": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
---
|
||||||
|
source: crates/tinymist-query/src/completion.rs
|
||||||
|
description: Completion on e (97..98)
|
||||||
|
expression: "JsonRepr::new_pure(results)"
|
||||||
|
input_file: crates/tinymist-query/src/fixtures/completion/func_pos_arg_field_call2.typ
|
||||||
|
snapshot_kind: text
|
||||||
|
---
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"isIncomplete": false,
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"kind": 3,
|
||||||
|
"label": "text",
|
||||||
|
"labelDetails": {
|
||||||
|
"description": "(content, str, alternates: bool, baseline: length, bottom-edge: \"baseline\" | \"bounds\" | \"descender\" | length, cjk-latin-spacing: auto | none, costs: dictionary, dir: dir, discretionary-ligatures: bool, fallback: bool, features: array | dictionary, fill: color, font: array | text.font, fractions: bool, historical-ligatures: bool, hyphenate: auto | bool, kerning: bool, lang: text.lang, ligatures: bool, number-type: \"lining\" | \"old-style\" | auto, number-width: \"proportional\" | \"tabular\" | auto, overhang: bool, region: text.region, script: auto | str, size: text.size, slashed-zero: bool, spacing: relative, stretch: ratio, stroke: stroke, style: \"italic\" | \"normal\" | \"oblique\", stylistic-set: array | int | none, top-edge: \"ascender\" | \"baseline\" | \"bounds\" | \"cap-height\" | \"x-height\" | length, tracking: length, weight: \"black\" | \"bold\" | \"extrabold\" | \"extralight\" | \"light\" | \"medium\" | \"regular\" | \"semibold\" | \"thin\" | int) => text"
|
||||||
|
},
|
||||||
|
"textEdit": {
|
||||||
|
"newText": "text(${1:}), ",
|
||||||
|
"range": {
|
||||||
|
"end": {
|
||||||
|
"character": 71,
|
||||||
|
"line": 2
|
||||||
|
},
|
||||||
|
"start": {
|
||||||
|
"character": 70,
|
||||||
|
"line": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
---
|
||||||
|
source: crates/tinymist-query/src/completion.rs
|
||||||
|
description: Completion on . (95..96)
|
||||||
|
expression: "JsonRepr::new_pure(results)"
|
||||||
|
input_file: crates/tinymist-query/src/fixtures/completion/func_pos_arg_field_middle.typ
|
||||||
|
snapshot_kind: text
|
||||||
|
---
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"isIncomplete": false,
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"kind": 5,
|
||||||
|
"label": "mode",
|
||||||
|
"labelDetails": {
|
||||||
|
"description": "\"code\" | \"markup\" | \"math\""
|
||||||
|
},
|
||||||
|
"sortText": "000",
|
||||||
|
"textEdit": {
|
||||||
|
"newText": "mode: ${1:}",
|
||||||
|
"range": {
|
||||||
|
"end": {
|
||||||
|
"character": 69,
|
||||||
|
"line": 2
|
||||||
|
},
|
||||||
|
"start": {
|
||||||
|
"character": 69,
|
||||||
|
"line": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
source: crates/tinymist-query/src/completion.rs
|
||||||
|
description: Completion on / (62..63)
|
||||||
|
expression: "JsonRepr::new_pure(results)"
|
||||||
|
input_file: crates/tinymist-query/src/fixtures/completion/func_pos_arg_field_simple.typ
|
||||||
|
snapshot_kind: text
|
||||||
|
---
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"isIncomplete": false,
|
||||||
|
"items": []
|
||||||
|
}
|
||||||
|
]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue