mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-24 21:19:37 +00:00
feat(lint): add warning for vf font (#1649)
* feat(lint): add warning for vf font * feat: detect font object --------- Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
This commit is contained in:
parent
1cd566aedc
commit
58ec6ab1e1
7 changed files with 114 additions and 0 deletions
5
crates/tinymist-query/src/fixtures/lint/good_font.typ
Normal file
5
crates/tinymist-query/src/fixtures/lint/good_font.typ
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
#text(font: "DejaVu Sans Mono")[123]
|
||||
#text(font: ("DejaVu Sans Mono",))[123]
|
||||
#text(font: (name: "DejaVu Sans Mono"))[123]
|
||||
#text(font: ((name: "DejaVu Sans Mono"),))[123]
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/analysis.rs
|
||||
expression: "JsonRepr::new_redacted(result, &REDACT_LOC)"
|
||||
input_file: crates/tinymist-query/src/fixtures/lint/good_font.typ
|
||||
---
|
||||
{}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/analysis.rs
|
||||
expression: "JsonRepr::new_redacted(result, &REDACT_LOC)"
|
||||
input_file: crates/tinymist-query/src/fixtures/lint/vf.typ
|
||||
---
|
||||
{
|
||||
"s0.typ": [
|
||||
{
|
||||
"message": "variable font is not supported by typst yet\nHint: consider using a static font instead. For more information, see https://github.com/typst/typst/issues/185",
|
||||
"range": "0:16:0:30",
|
||||
"severity": 2,
|
||||
"source": "typst"
|
||||
},
|
||||
{
|
||||
"message": "variable font is not supported by typst yet\nHint: consider using a static font instead. For more information, see https://github.com/typst/typst/issues/185",
|
||||
"range": "2:22:2:36",
|
||||
"severity": 2,
|
||||
"source": "typst"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/analysis.rs
|
||||
expression: "JsonRepr::new_redacted(result, &REDACT_LOC)"
|
||||
input_file: crates/tinymist-query/src/fixtures/lint/vf_object.typ
|
||||
---
|
||||
{
|
||||
"s0.typ": [
|
||||
{
|
||||
"message": "variable font is not supported by typst yet\nHint: consider using a static font instead. For more information, see https://github.com/typst/typst/issues/185",
|
||||
"range": "0:20:0:34",
|
||||
"severity": 2,
|
||||
"source": "typst"
|
||||
},
|
||||
{
|
||||
"message": "variable font is not supported by typst yet\nHint: consider using a static font instead. For more information, see https://github.com/typst/typst/issues/185",
|
||||
"range": "1:19:1:33",
|
||||
"severity": 2,
|
||||
"source": "typst"
|
||||
}
|
||||
]
|
||||
}
|
||||
3
crates/tinymist-query/src/fixtures/lint/vf.typ
Normal file
3
crates/tinymist-query/src/fixtures/lint/vf.typ
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#set text(font: "Noto Sans VF")
|
||||
|
||||
#text(font: ("Arial", "Noto Sans VF"))[123]
|
||||
3
crates/tinymist-query/src/fixtures/lint/vf_object.typ
Normal file
3
crates/tinymist-query/src/fixtures/lint/vf_object.typ
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
#text(font: ((name: "Noto Sans VF"),))[123]
|
||||
#text(font: (name: "Noto Sans VF"))[123]
|
||||
Loading…
Add table
Add a link
Reference in a new issue