@@ -2,25 +2,9 @@ local h = require("null-ls.helpers")
2
2
local methods = require (" null-ls.methods" )
3
3
local log = require (" null-ls.logger" )
4
4
local client = require (" null-ls.client" )
5
- local async = require (" plenary.async" )
6
- local Job = require (" plenary.job" )
7
5
8
6
local FORMATTING = methods .internal .FORMATTING
9
7
10
- local run_job = async .wrap (function (opts , done )
11
- opts .on_exit = function (j , status )
12
- done (status , j :result (), j :stderr_result ())
13
- end
14
-
15
- Job :new (opts ):start ()
16
- end , 2 )
17
-
18
- local tmpname = async .wrap (function (done )
19
- vim .defer_fn (function ()
20
- done (vim .fn .tempname ())
21
- end , 0 )
22
- end , 1 )
23
-
24
8
--- Asynchronously computes the command that `nix fmt` would run, or nil if
25
9
--- we're not in a flake with a formatter, or if we fail to discover the
26
10
--- formatter somehow. When finished, it invokes the `done` callback with a
@@ -38,6 +22,23 @@ end, 1)
38
22
local find_nix_fmt = function (opts , done )
39
23
done = vim .schedule_wrap (done )
40
24
25
+ local async = require (" plenary.async" )
26
+ local Job = require (" plenary.job" )
27
+
28
+ local run_job = async .wrap (function (_opts , _done )
29
+ _opts .on_exit = function (j , status )
30
+ _done (status , j :result (), j :stderr_result ())
31
+ end
32
+
33
+ Job :new (_opts ):start ()
34
+ end , 2 )
35
+
36
+ local tmpname = async .wrap (function (_done )
37
+ vim .defer_fn (function ()
38
+ _done (vim .fn .tempname ())
39
+ end , 0 )
40
+ end , 1 )
41
+
41
42
async .run (function ()
42
43
local title = " discovering `nix fmt` entrypoint"
43
44
local progress_token = " nix-flake-fmt-discovery"
0 commit comments