mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-24 13:13:43 +00:00
fix: forbid some bad cases of dot access (#1497)
* fix: forbid some bad cases of dot access * test: add a countercase * fix: revert a case
This commit is contained in:
parent
7399fccd5a
commit
648523967c
9 changed files with 129 additions and 1 deletions
|
@ -0,0 +1,4 @@
|
|||
/// contains: abs
|
||||
|
||||
// @typstyle off
|
||||
$ arrow./* range 0..1 */ $
|
|
@ -0,0 +1,4 @@
|
|||
/// contains: abs
|
||||
/// trigger_character: .
|
||||
|
||||
$ ./* range 0..1 */ $
|
|
@ -0,0 +1,4 @@
|
|||
/// contains: abs
|
||||
/// trigger_character: .
|
||||
|
||||
$./* range 0..1 */ $
|
|
@ -0,0 +1,4 @@
|
|||
/// contains: abs
|
||||
/// trigger_character: .
|
||||
|
||||
$ a./* range 0..1 */ $
|
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/completion.rs
|
||||
description: Completion on / (44..45)
|
||||
expression: "JsonRepr::new_pure(results)"
|
||||
input_file: crates/tinymist-query/src/fixtures/completion/field_math_postfix.typ
|
||||
---
|
||||
[
|
||||
{
|
||||
"isIncomplete": false,
|
||||
"items": [
|
||||
{
|
||||
"kind": 3,
|
||||
"label": "abs",
|
||||
"labelDetails": {
|
||||
"description": "(content, size: relative) => content"
|
||||
},
|
||||
"textEdit": {
|
||||
"newText": "",
|
||||
"range": {
|
||||
"end": {
|
||||
"character": 8,
|
||||
"line": 3
|
||||
},
|
||||
"start": {
|
||||
"character": 8,
|
||||
"line": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/completion.rs
|
||||
description: Completion on / (47..48)
|
||||
expression: "JsonRepr::new_pure(results)"
|
||||
input_file: crates/tinymist-query/src/fixtures/completion/math_dot.typ
|
||||
---
|
||||
[
|
||||
{
|
||||
"isIncomplete": false,
|
||||
"items": []
|
||||
}
|
||||
]
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/completion.rs
|
||||
description: Completion on / (46..47)
|
||||
expression: "JsonRepr::new_pure(results)"
|
||||
input_file: crates/tinymist-query/src/fixtures/completion/math_dot2.typ
|
||||
---
|
||||
[
|
||||
{
|
||||
"isIncomplete": false,
|
||||
"items": []
|
||||
}
|
||||
]
|
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/completion.rs
|
||||
description: Completion on / (48..49)
|
||||
expression: "JsonRepr::new_pure(results)"
|
||||
input_file: crates/tinymist-query/src/fixtures/completion/math_dot3.typ
|
||||
---
|
||||
[
|
||||
{
|
||||
"isIncomplete": false,
|
||||
"items": [
|
||||
{
|
||||
"kind": 3,
|
||||
"label": "abs",
|
||||
"labelDetails": {
|
||||
"description": "(content, size: relative) => content"
|
||||
},
|
||||
"textEdit": {
|
||||
"newText": "",
|
||||
"range": {
|
||||
"end": {
|
||||
"character": 4,
|
||||
"line": 3
|
||||
},
|
||||
"start": {
|
||||
"character": 4,
|
||||
"line": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue