Skip to content

Commit b1e74bd

Browse files
authored
feat(builtins): add typstyle formatter for typst (#146)
1 parent 8691504 commit b1e74bd

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

doc/BUILTINS.md

+17
Original file line numberDiff line numberDiff line change
@@ -3869,6 +3869,23 @@ local sources = { null_ls.builtins.formatting.typstfmt }
38693869
- Command: `typstfmt`
38703870
- Args: `{ "-o", "-" }`
38713871

3872+
### [typstyle](https://github.com/Enter-tainer/typstyle/)
3873+
3874+
Formatter for typst
3875+
3876+
#### Usage
3877+
3878+
```lua
3879+
local sources = { null_ls.builtins.formatting.typstyle }
3880+
```
3881+
3882+
#### Defaults
3883+
3884+
- Filetypes: `{ "typ", "typst" }`
3885+
- Method: `formatting`
3886+
- Command: `typstyle`
3887+
- Args: `{}`
3888+
38723889
### [uncrustify](https://github.com/uncrustify/uncrustify)
38733890

38743891
A source code beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and Vala.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
local h = require("null-ls.helpers")
2+
local methods = require("null-ls.methods")
3+
4+
local FORMATTING = methods.internal.FORMATTING
5+
6+
return h.make_builtin({
7+
name = "typstyle",
8+
meta = {
9+
url = "https://github.com/Enter-tainer/typstyle/",
10+
description = "Beautiful and reliable typst code formatter",
11+
},
12+
method = FORMATTING,
13+
filetypes = { "typ", "typst" },
14+
generator_opts = {
15+
command = "typstyle",
16+
to_stdin = true,
17+
},
18+
factory = h.formatter_factory,
19+
})

0 commit comments

Comments
 (0)