@@ -82,7 +82,17 @@ var Commands = []Command{
8282 }},
8383}
8484
85- var SourceExtensions = map [string ]bool {".c" : true , ".h" : true , ".S" : true , ".rs" : true }
85+ func IsSourceFile (file string ) bool {
86+ return sourceFiles [file ] || sourceExtensions [filepath .Ext (file )]
87+ }
88+
89+ var (
90+ // Files and extensions we want to keep in the build dir and make available to LLM agents.
91+ sourceExtensions = map [string ]bool {".c" : true , ".h" : true , ".S" : true , ".rs" : true }
92+ sourceFiles = map [string ]bool {
93+ ".config" : true ,
94+ }
95+ )
8696
8797func NewIndex (databaseFile string , srcDirs []string ) (* Index , error ) {
8898 db , err := osutil.ReadJSON [* Database ](databaseFile )
@@ -275,6 +285,7 @@ func escaping(path string) error {
275285}
276286
277287func dirIndex (root , subdir string ) (bool , []string , []string , error ) {
288+ subdir = filepath .Clean (subdir )
278289 dir := filepath .Join (root , subdir )
279290 entries , err := os .ReadDir (dir )
280291 if err != nil {
@@ -293,7 +304,7 @@ func dirIndex(root, subdir string) (bool, []string, []string, error) {
293304 // These are internal things like .git, etc.
294305 } else if entry .IsDir () {
295306 subdirs = append (subdirs , entry .Name ())
296- } else if SourceExtensions [ filepath .Ext ( entry .Name ())] {
307+ } else if IsSourceFile ( filepath .Join ( subdir , entry .Name ())) {
297308 files = append (files , entry .Name ())
298309 }
299310 }
0 commit comments