mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-09 21:12:31 +08:00
Enable C flag parsing by default
The options for parsing `make -n` and `compile_commands.json` flags are now enabled by default, so people can start getting better flags for their files by default. `compile_commands.json` flags are now preferred over `make -n` results, to make the options work better by default.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
" Author: gagbo <gagbobada@gmail.com>, w0rp <devw0rp@gmail.com>, roel0 <postelmansroel@gmail.com>
|
||||
" Description: Functions for integrating with C-family linters.
|
||||
|
||||
call ale#Set('c_parse_makefile', 0)
|
||||
call ale#Set('c_parse_compile_commands', 0)
|
||||
call ale#Set('c_parse_makefile', 1)
|
||||
call ale#Set('c_parse_compile_commands', 1)
|
||||
let s:sep = has('win32') ? '\' : '/'
|
||||
|
||||
" Set just so tests can override it.
|
||||
@@ -334,10 +334,6 @@ endfunction
|
||||
function! ale#c#GetCFlags(buffer, output) abort
|
||||
let l:cflags = v:null
|
||||
|
||||
if ale#Var(a:buffer, 'c_parse_makefile') && !empty(a:output)
|
||||
let l:cflags = ale#c#ParseCFlagsFromMakeOutput(a:buffer, a:output)
|
||||
endif
|
||||
|
||||
if ale#Var(a:buffer, 'c_parse_compile_commands')
|
||||
let [l:root, l:json_file] = ale#c#FindCompileCommands(a:buffer)
|
||||
|
||||
@@ -346,6 +342,12 @@ function! ale#c#GetCFlags(buffer, output) abort
|
||||
endif
|
||||
endif
|
||||
|
||||
if ale#Var(a:buffer, 'c_parse_makefile')
|
||||
\&& !empty(a:output)
|
||||
\&& !empty(l:cflags)
|
||||
let l:cflags = ale#c#ParseCFlagsFromMakeOutput(a:buffer, a:output)
|
||||
endif
|
||||
|
||||
if l:cflags is v:null
|
||||
let l:cflags = ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer))
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user