Skip to content

Commit

Permalink
feat(builtins): add typstyle formatter for typst (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
PriceHiller committed Jun 14, 2024
1 parent 8691504 commit b1e74bd
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
17 changes: 17 additions & 0 deletions doc/BUILTINS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3869,6 +3869,23 @@ local sources = { null_ls.builtins.formatting.typstfmt }
- Command: `typstfmt`
- Args: `{ "-o", "-" }`

### [typstyle](https://github.com/Enter-tainer/typstyle/)

Formatter for typst

#### Usage

```lua
local sources = { null_ls.builtins.formatting.typstyle }
```

#### Defaults

- Filetypes: `{ "typ", "typst" }`
- Method: `formatting`
- Command: `typstyle`
- Args: `{}`

### [uncrustify](https://github.com/uncrustify/uncrustify)

A source code beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and Vala.
Expand Down
19 changes: 19 additions & 0 deletions lua/null-ls/builtins/formatting/typstyle.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
local h = require("null-ls.helpers")
local methods = require("null-ls.methods")

local FORMATTING = methods.internal.FORMATTING

return h.make_builtin({
name = "typstyle",
meta = {
url = "https://github.com/Enter-tainer/typstyle/",
description = "Beautiful and reliable typst code formatter",
},
method = FORMATTING,
filetypes = { "typ", "typst" },
generator_opts = {
command = "typstyle",
to_stdin = true,
},
factory = h.formatter_factory,
})

0 comments on commit b1e74bd

Please sign in to comment.