From fb514ca90fb8ead3b6483774aaa317e1e63b7a47 Mon Sep 17 00:00:00 2001 From: Chad Skeeters Date: Tue, 20 May 2025 14:43:21 -0500 Subject: [PATCH 1/3] Adds Typst syntax from hyrious/typst-syntax-highlight --- .gitmodules | 3 ++ .../syntaxes/02_Extra/typst-syntax-highlight | 1 + tests/syntax-tests/highlighted/Typst/test.typ | 28 +++++++++++++++++++ tests/syntax-tests/source/Typst/test.typ | 28 +++++++++++++++++++ 4 files changed, 60 insertions(+) create mode 160000 assets/syntaxes/02_Extra/typst-syntax-highlight create mode 100644 tests/syntax-tests/highlighted/Typst/test.typ create mode 100644 tests/syntax-tests/source/Typst/test.typ diff --git a/.gitmodules b/.gitmodules index 1eae9184..697b2500 100644 --- a/.gitmodules +++ b/.gitmodules @@ -269,3 +269,6 @@ [submodule "assets/syntaxes/02_Extra/sublime-odin"] path = assets/syntaxes/02_Extra/sublime-odin url = https://github.com/odin-lang/sublime-odin +[submodule "assets/syntaxes/02_Extra/typst-syntax-highlight"] + path = assets/syntaxes/02_Extra/typst-syntax-highlight + url = https://github.com/hyrious/typst-syntax-highlight diff --git a/assets/syntaxes/02_Extra/typst-syntax-highlight b/assets/syntaxes/02_Extra/typst-syntax-highlight new file mode 160000 index 00000000..1bde1ea5 --- /dev/null +++ b/assets/syntaxes/02_Extra/typst-syntax-highlight @@ -0,0 +1 @@ +Subproject commit 1bde1ea511d86c622a0fd27d9e0db3e047d4094f diff --git a/tests/syntax-tests/highlighted/Typst/test.typ b/tests/syntax-tests/highlighted/Typst/test.typ new file mode 100644 index 00000000..c14a24fe --- /dev/null +++ b/tests/syntax-tests/highlighted/Typst/test.typ @@ -0,0 +1,28 @@ +#set text(9.5pt) + += Heading + +- Bullet 1 +- Bullet 2 +- Bullet 3 + ++ List 1 ++ List 2 ++ List 3 + +#figure( + table( + columns: (auto, auto), + table.header( + [Name], [Age], + ), + [John], [50], + [Jane], [48], + ), + caption: [People], +) + +```python +dev foo(): + print("hi") +``` diff --git a/tests/syntax-tests/source/Typst/test.typ b/tests/syntax-tests/source/Typst/test.typ new file mode 100644 index 00000000..395258f7 --- /dev/null +++ b/tests/syntax-tests/source/Typst/test.typ @@ -0,0 +1,28 @@ +#set text(9.5pt) + += Heading + +- Bullet 1 +- Bullet 2 +- Bullet 3 + ++ List 1 ++ List 2 ++ List 3 + +#figure( + table( + columns: (auto, auto), + table.header( + [Name], [Age], + ), + [John], [50], + [Jane], [48], + ), + caption: [People], +) + +```python +dev foo(): + print("hi") +``` From 36a86d34e866e12f6ea00a534e15ec565f1fd028 Mon Sep 17 00:00:00 2001 From: Chad Skeeters Date: Tue, 20 May 2025 14:50:53 -0500 Subject: [PATCH 2/3] Adds changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce162b40..ecf1c76b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ - Add syntax definition and test file for GDScript highlighting, see #3236 (@chetanjangir0) - Add syntax test file for Odin highlighting, see #3241 (@chetanjangir0) - Update quadlet syntax mapping rules to cover quadlets in subdirectories #3299 (@cyqsimon) +- Add syntax Typst #3300 (@cskeeters) ## Themes From 4c9a51990c4d9172a227a17b53987d178bb3b17d Mon Sep 17 00:00:00 2001 From: Chad Skeeters Date: Tue, 20 May 2025 16:35:47 -0500 Subject: [PATCH 3/3] Corrects spelling mistake in syntax-test for Typst --- tests/syntax-tests/highlighted/Typst/test.typ | 2 +- tests/syntax-tests/source/Typst/test.typ | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/syntax-tests/highlighted/Typst/test.typ b/tests/syntax-tests/highlighted/Typst/test.typ index c14a24fe..55ee54bd 100644 --- a/tests/syntax-tests/highlighted/Typst/test.typ +++ b/tests/syntax-tests/highlighted/Typst/test.typ @@ -23,6 +23,6 @@ ) ```python -dev foo(): +def foo():  print("hi") ``` diff --git a/tests/syntax-tests/source/Typst/test.typ b/tests/syntax-tests/source/Typst/test.typ index 395258f7..d27b3aa4 100644 --- a/tests/syntax-tests/source/Typst/test.typ +++ b/tests/syntax-tests/source/Typst/test.typ @@ -23,6 +23,6 @@ ) ```python -dev foo(): +def foo(): print("hi") ```