summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJon Parise <jon@indelible.org>2018-10-30 08:54:40 -0700
committerJon Parise <jon@indelible.org>2018-10-31 08:42:42 -0700
commitb5a7593577e1ada3f81fdaa68862ad4e93dcb5a5 (patch)
tree88ac692c488b1acc149f3f6c5b114609cea586e1 /doc
parent20e4e3f9db1e46306bbe8ba5c33db92950b2e927 (diff)
downloadale-b5a7593577e1ada3f81fdaa68862ad4e93dcb5a5.zip
Add a `lsp_config_callback` linter option
This is the callback-based variant of the existing `lsp_config` linter option. It serves the same purpose but can be used when more complicated processing is needed. `lsp_config` and `lsp_config_callback` are mutually exclusive options; if both an given, a linter preprocessing error will be raised. The runtime logic has been wrapped in `ale#lsp_linter#GetConfig` for convenience, similar to `ale#lsp_linter#GetOptions`. This also adds documentation and an `AssertLSPConfig` test function for completeness.
Diffstat (limited to 'doc')
-rw-r--r--doc/ale-development.txt1
-rw-r--r--doc/ale.txt13
2 files changed, 14 insertions, 0 deletions
diff --git a/doc/ale-development.txt b/doc/ale-development.txt
index ac72d615..1e168130 100644
--- a/doc/ale-development.txt
+++ b/doc/ale-development.txt
@@ -306,6 +306,7 @@ given the above setup are as follows.
`AssertLinterNotExecuted` - Check that linters will not be executed.
`AssertLSPLanguage language` - Check the language given to an LSP server.
`AssertLSPOptions options_dict` - Check the options given to an LSP server.
+`AssertLSPConfig config_dict` - Check the config given to an LSP server.
`AssertLSPProject project_root` - Check the root given to an LSP server.
`AssertLSPAddress address` - Check the address to an LSP server.
diff --git a/doc/ale.txt b/doc/ale.txt
index 21fab16c..72de1cc5 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -2666,6 +2666,9 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()*
`initialization_options_callback` may be defined to
pass initialization options to the LSP.
+ An optional `lsp_config` or `lsp_config_callback` may
+ be defined to pass configuration settings to the LSP.
+
`address_callback` A |String| or |Funcref| for a callback function
accepting a buffer number. A |String| should be
returned with an address to connect to.
@@ -2726,6 +2729,16 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()*
This can be used in place of `initialization_options`
when more complicated processing is needed.
+ `lsp_config` A |Dictionary| of configuration settings for LSPs.
+ This will be fed (as JSON) to the LSP in the
+ workspace/didChangeConfiguration command.
+
+ `lsp_config_callback` A |String| or |Funcref| for a callback function
+ accepting a buffer number. A |Dictionary| should be
+ returned for configuration settings to pass the LSP.
+ This can be used in place of `lsp_config` when more
+ complicated processing is needed.
+
Only one of `command`, `command_callback`, or `command_chain` should be
specified. `command_callback` is generally recommended when a command string
needs to be generated dynamically, or any global options are used.