diff options
author | Tadeas Uhlir <tadeas.uhlir@gmail.com> | 2019-02-04 16:50:46 -0500 |
---|---|---|
committer | Tadeas Uhlir <tadeas.uhlir@gmail.com> | 2019-02-04 16:50:46 -0500 |
commit | 37daedafed010e7e880e88137c98b35ea0d40cd1 (patch) | |
tree | 29e9ce490fafa57f2948b3a8fb5bae30e99f932b | |
parent | 4d426bf2873c6e1cd2c71e478c756903307628d3 (diff) | |
download | ale-37daedafed010e7e880e88137c98b35ea0d40cd1.zip |
Fix error when parsing compile_commands for c langs
This little error caused that when parsing compile_commands json, the
filename was used to fetch entries in directory dictionary, hence, when
adding new json commands, it never found anything in dir_lookup and
instead rewrote the previous entry. Hence, the dir_lookup always
contained list of only one compile_command per directory instead of all
compile_commands for given directory.
-rw-r--r-- | autoload/ale/c.vim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/autoload/ale/c.vim b/autoload/ale/c.vim index 6ac2d398..99791261 100644 --- a/autoload/ale/c.vim +++ b/autoload/ale/c.vim @@ -202,7 +202,7 @@ function! s:GetLookupFromCompileCommandsFile(compile_commands_file) abort let l:file_lookup[l:basename] = get(l:file_lookup, l:basename, []) + [l:entry] let l:dirbasename = tolower(fnamemodify(l:entry.directory, ':p:h:t')) - let l:dir_lookup[l:dirbasename] = get(l:dir_lookup, l:basename, []) + [l:entry] + let l:dir_lookup[l:dirbasename] = get(l:dir_lookup, l:dirbasename, []) + [l:entry] endfor if !empty(l:file_lookup) && !empty(l:dir_lookup) |