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.
This commit is contained in:
parent
cd254a8af4
commit
f67539882c
1 changed files with 16 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue