@@ -1005,15 +1005,40 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()*
1005
1005
check, and will produce the lines of output given to
1006
1006
the `callback` .
1007
1007
1008
- Either this or the `command_callback` argument must
1009
- be provided.
1010
-
1011
1008
`command_callback` A | String | or | Funcref | for a callback function
1012
1009
accepting a buffer number. A | String | should be
1013
1010
returned for a command to run. This can be used in
1014
1011
place of `command ` when more complicated processing
1015
1012
is needed.
1016
1013
1014
+ `command_chain` A | List | of | Dictionary | items defining a series
1015
+ of commands to be run. At least one | Dictionary |
1016
+ should be provided. Each Dictionary must contain the
1017
+ key `callback` , defining a | String | or | Funcref | for
1018
+ a function returning a | String | for a command to run.
1019
+
1020
+ The callback functions for each command after the
1021
+ first command in in the chain should accept two
1022
+ arguments `(buffer, output)`, a buffer number and a
1023
+ | List | of lines of output from the previous command
1024
+ in the chain.
1025
+
1026
+ The first callback function in a chain accepts only
1027
+ a `(buffer )` argument, as there are no previous
1028
+ commands to run which return `output` .
1029
+
1030
+ Commands in the chain will all use the
1031
+ `output_stream` value provided in the root
1032
+ | Dictionary | . Each command in the chain can also
1033
+ provide an `output_stream` key to override this value.
1034
+ See the `output_stream` description for more
1035
+ information.
1036
+
1037
+ The Vim buffer being checked for linter will only
1038
+ be sent to the final command in the chain. Previous
1039
+ commands in the chain will receive no input from
1040
+ stdin.
1041
+
1017
1042
`output_stream` A | String | for the output stream the lines of output
1018
1043
should be read from for the command which is run. The
1019
1044
accepted values are `' stdout' ` , `' stderr' ` , and
@@ -1023,6 +1048,12 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()*
1023
1048
instead of stdout. The option `' both' ` will read
1024
1049
from both stder and stdout at the same time.
1025
1050
1051
+ Only one of `command ` , `command_callback` , or `command_chain` should be
1052
+ specified. `command_callback` is generally recommended when a command string
1053
+ needs to be generated dynamically, or any global options are used.
1054
+ `command_chain` is recommended where any system calls need to be made to
1055
+ retrieve some kind of information before running the final command.
1056
+
1026
1057
Some programs for checking for errors are not capable of receiving input
1027
1058
from stdin, as is required by ALE. To remedy this, a wrapper script is
1028
1059
provided named in the variable | g:ale#util#stdin_wrapper | . This variable
0 commit comments