@@ -281,10 +281,12 @@ All return values are **required** unless specified as optional.
281
281
#### Code Actions
282
282
283
283
``` lua
284
- return { {
285
- title , -- string
286
- action , -- function (callback with no arguments)
287
- } }
284
+ return {
285
+ {
286
+ title , -- string
287
+ action , -- function (callback with no arguments)
288
+ },
289
+ }
288
290
```
289
291
290
292
Once generated, null-ls stores code action results in its internal state and
@@ -298,18 +300,20 @@ safe to call any API function.
298
300
299
301
``` lua
300
302
-- null-ls assumes ranges are 1-indexed, so sources should offset if not
301
- return { {
302
- row , -- number, optional (defaults to first line)
303
- col , -- number, optional (defaults to beginning of line)
304
- end_row , -- number, optional (defaults to row)
305
- end_col , -- number, optional (defaults to end of line),
306
- source , -- string, optional (defaults to "null-ls")
307
- code , -- number, optional
308
- message , -- string
309
- severity , -- 1 (error), 2 (warning), 3 (information), 4 (hint)
310
- filename , -- string, optional (requires generator.multiple_files)
311
- bufnr , -- number, optional (requires generator.multiple_files)
312
- } }
303
+ return {
304
+ {
305
+ row , -- number, optional (defaults to first line)
306
+ col , -- number, optional (defaults to beginning of line)
307
+ end_row , -- number, optional (defaults to row)
308
+ end_col , -- number, optional (defaults to end of line),
309
+ source , -- string, optional (defaults to "null-ls")
310
+ code , -- number, optional
311
+ message , -- string
312
+ severity , -- 1 (error), 2 (warning), 3 (information), 4 (hint)
313
+ filename , -- string, optional (requires generator.multiple_files)
314
+ bufnr , -- number, optional (requires generator.multiple_files)
315
+ },
316
+ }
313
317
```
314
318
315
319
null-ls generates diagnostics in response to LSP notifications and publishes
@@ -329,13 +333,15 @@ described in [CONFIG](./CONFIG.md).
329
333
#### Formatting
330
334
331
335
``` lua
332
- return { {
333
- row , -- number, optional (see diagnostics for defaults)
334
- col , -- number, optional
335
- end_row , -- number, optional
336
- end_col , -- number, optional
337
- text , -- string
338
- } }
336
+ return {
337
+ {
338
+ row , -- number, optional (see diagnostics for defaults)
339
+ col , -- number, optional
340
+ end_row , -- number, optional
341
+ end_col , -- number, optional
342
+ text , -- string
343
+ },
344
+ }
339
345
```
340
346
341
347
null-ls applies formatting results to the matching buffer and, depending on the
0 commit comments