diff options
| author | copilot-swe-agent[bot] | 2026-02-17 20:28:19 +0000 |
|---|---|---|
| committer | copilot-swe-agent[bot] | 2026-02-17 20:28:19 +0000 |
| commit | c849345a8d2c3b0d0d3d3f9a7c9acc4392cd3d24 (patch) | |
| tree | a4c2ff0f783f34c45e41aec03f59cec18180793b | |
| parent | 014c959fee6dcf829177d2f4c43b2c5a655a2971 (diff) | |
| download | ale-copilot/fix-ale-compile-commands-path.tar.gz | |
Add defensive ale#Set for cbuilddir_names in FindCompileCommands
copilot/fix-ale-compile-commands-pathCo-authored-by: w0rp <3518142+w0rp@users.noreply.github.com>
| -rw-r--r-- | autoload/ale/c.vim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/autoload/ale/c.vim b/autoload/ale/c.vim index 11c2eb3d9..329637b5c 100644 --- a/autoload/ale/c.vim +++ b/autoload/ale/c.vim @@ -246,6 +246,15 @@ function! ale#c#FindCompileCommands(buffer) abort return [fnamemodify(l:json_file, ':h'), l:json_file] endif + " Something somewhere seems to delete this setting in tests, so ensure + " we always have a default value. + call ale#Set('c_build_dir_names', [ + \ 'build', + \ 'build/Debug', + \ 'build/Release', + \ 'bin', + \]) + " Search in build directories if we can't find it in the project. for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h')) for l:dirname in ale#Var(a:buffer, 'c_build_dir_names') |