From f67539882c862e9b705c0a65dcdddf2b993b8cf7 Mon Sep 17 00:00:00 2001 From: Suhas S Date: Sun, 24 Aug 2025 23:41:18 +0800 Subject: [PATCH] fix: CSS files not being indexed (#7072) CSS files were not being indexed because codeChunker expects code structures (classes/functions) that don't exist in CSS. The chunker would return zero chunks, preventing CSS files from being indexed. This fix routes CSS, HTML, JSON and similar non-code files to basicChunker instead of codeChunker, ensuring they are properly indexed while maintaining intelligent chunking for actual code files. --- core/indexing/chunk/chunk.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/core/indexing/chunk/chunk.ts b/core/indexing/chunk/chunk.ts index de9a33f9c..73108bf40 100644 --- a/core/indexing/chunk/chunk.ts +++ b/core/indexing/chunk/chunk.ts @@ -22,7 +22,22 @@ export async function* chunkDocumentWithoutId( return; } const extension = getUriFileExtension(fileUri); - if (extension in supportedLanguages) { + // Files that should use basicChunker despite having tree-sitter support + // These files don't have code structure (classes/functions) that codeChunker expects + const NON_CODE_EXTENSIONS = [ + "css", + "html", + "htm", + "json", + "toml", + "yaml", + "yml", + ]; + + if ( + extension in supportedLanguages && + !NON_CODE_EXTENSIONS.includes(extension) + ) { try { for await (const chunk of codeChunker(fileUri, contents, maxChunkSize)) { yield chunk;