diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2019-01-26 04:45:12 +0000 |
---|---|---|
committer | brian m. carlson <sandals@crustytoothpaste.net> | 2019-01-26 04:46:41 +0000 |
commit | 6fc016ad052725e0d6a474e80f817cb1853e98e2 (patch) | |
tree | 974a57185079982a6ccb8565155909fa2f127d26 /doc | |
parent | 766636e0c436d8508ae45c51df9229745b4d05d1 (diff) | |
download | ale-6fc016ad052725e0d6a474e80f817cb1853e98e2.zip |
Add additional ways to detect LSP project root
Currently, we detect the linter root based on a variety of techniques.
However, these techniques are not foolproof. For example, clangd works
fine for many things without a compile_commands.json file, and Go
projects may be built outside of the GOPATH to take advantage of Go
1.11's automatic module support.
Add global and buffer-specific variables to allow the user to specify
the root, either as a string or a funcref. Make the funcrefs accept the
buffer number as an argument to make sure that they can function easily
in an asynchronous environment.
We define the global variable in the main plugin, since the LSP linter
code is not loaded unless required, and we want the variable to be able
to be read correctly by :ALEInfo regardless.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ale.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/ale.txt b/doc/ale.txt index ac71ab83..a3884c5b 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -1572,6 +1572,22 @@ b:ale_loclist_msg_format *b:ale_loclist_msg_format* The strings for configuring `%severity%` are also used for this option. +g:ale_lsp_root *g:ale_lsp_root* +b:ale_lsp_root *b:ale_lsp_root* + + Type: |Dictionary| or |String| + Default: {} + + This option is used to determine the project root for the LSP linter. If the + value is a |Dictionary|, it maps a linter to either a string containing the + project root or a |Funcref| to call to look up the root. The funcref is + provided the buffer number as its argument. + + The buffer-specific variable may additionally be a string containing the + project root itself. + + If neither variable yields a result, a linter-specific function is invoked to + detect a project root. If this, too, yields no result, the linter is disabled. g:ale_max_buffer_history_size *g:ale_max_buffer_history_size* |