aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorcopilot-swe-agent[bot]2026-02-17 20:28:19 +0000
committercopilot-swe-agent[bot]2026-02-17 20:28:19 +0000
commitc849345a8d2c3b0d0d3d3f9a7c9acc4392cd3d24 (patch)
treea4c2ff0f783f34c45e41aec03f59cec18180793b
parent014c959fee6dcf829177d2f4c43b2c5a655a2971 (diff)
downloadale-copilot/fix-ale-compile-commands-path.tar.gz

Add defensive ale#Set for cbuilddir_names in FindCompileCommands

copilot/fix-ale-compile-commands-path
-rw-r--r--autoload/ale/c.vim9
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')