Skip to content

Commit e45670a

Browse files
authored
feat: add textidote support (#1616)
* feat: add textidote support * perf: change methods * fix: set multiple_files and add --quiet to args * fix: set default timeout to 5 seconds
1 parent 0789777 commit e45670a

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
local h = require("null-ls.helpers")
2+
local methods = require("null-ls.methods")
3+
4+
local DIAGNOSTICS_ON_OPEN = methods.internal.DIAGNOSTICS_ON_OPEN
5+
local DIAGNOSTICS_ON_SAVE = methods.internal.DIAGNOSTICS_ON_SAVE
6+
7+
return h.make_builtin({
8+
name = "textidote",
9+
meta = {
10+
url = "https://github.com/sylvainhalle/textidote",
11+
description = "Spelling, grammar and style checking on LaTeX documents.",
12+
},
13+
method = { DIAGNOSTICS_ON_OPEN, DIAGNOSTICS_ON_SAVE },
14+
filetypes = { "markdown", "tex" },
15+
generator_opts = {
16+
command = "textidote",
17+
args = {
18+
"--read-all",
19+
"--output",
20+
"singleline",
21+
"--no-color",
22+
"--check",
23+
"en",
24+
"--quiet",
25+
"$FILENAME",
26+
},
27+
format = "line",
28+
timeout = 5000,
29+
ignore_stderr = true,
30+
to_stdin = true,
31+
on_output = h.diagnostics.from_patterns({
32+
{
33+
pattern = [[(.*)%(L(%d+)C(%d+)-L(%d+)C(%d+)%): (.*)]],
34+
groups = { "filename", "row", "col", "end_row", "end_col", "message" },
35+
overrides = {
36+
diagnostic = {
37+
severity = h.diagnostics.severities.warning,
38+
},
39+
},
40+
},
41+
}),
42+
multiple_files = true,
43+
},
44+
factory = h.generator_factory,
45+
})

0 commit comments

Comments
 (0)