mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-10 05:22:31 +08:00
Add support for parsing compile_commands.json files for C compilers
This commit is contained in:
@@ -25,13 +25,28 @@ g:ale_c_build_dir *g:ale_c_build_dir*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
A path to the directory containing the `compile_commands.json` file to use
|
||||
with c-family linters. Usually setting this option to a non-empty string
|
||||
will override the |g:ale_c_build_dir_names| option to impose a compilation
|
||||
database (it can be useful if multiple builds are in multiple build
|
||||
subdirectories in the project tree).
|
||||
This feature is also most useful for the clang tools linters, wrapped
|
||||
around LibTooling (namely clang-tidy here)
|
||||
For programs that can read `compile_commands.json` files, this option can be
|
||||
set to the directory containing the file for the project. ALE will try to
|
||||
determine the location of `compile_commands.json` automatically, but if your
|
||||
file exists in some other directory, you can set this option so ALE will
|
||||
know where it is.
|
||||
|
||||
This directory will be searched instead of |g:ale_c_build_dir_names|.
|
||||
|
||||
|
||||
g:ale_c_parse_compile_commands *g:ale_c_parse_compile_commands*
|
||||
*b:ale_c_parse_compile_commands*
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
If set to `1`, ALE will parse `compile_commands.json` files to automatically
|
||||
determine flags for C or C++ compilers. ALE will first search for the
|
||||
nearest `compile_commands.json` file, and then look for
|
||||
`compile_commands.json` files in the directories for
|
||||
|g:ale_c_build_dir_names|.
|
||||
|
||||
If |g:ale_c_parse_makefile| or |b:ale_c_parse_makefile| is set to `1`, the
|
||||
output of `make -n` will be preferred over `compile_commands.json` files.
|
||||
|
||||
|
||||
g:ale_c_parse_makefile *g:ale_c_parse_makefile*
|
||||
|
||||
@@ -10,6 +10,7 @@ The following C options also apply to some C++ linters too.
|
||||
* |g:ale_c_build_dir_names|
|
||||
* |g:ale_c_build_dir|
|
||||
* |g:ale_c_parse_makefile|
|
||||
* |g:ale_c_parse_compile_commands|
|
||||
|
||||
|
||||
===============================================================================
|
||||
|
||||
Reference in New Issue
Block a user