fix(extraction): count all file-level-tracked langs (incl .properties) as indexed (#544)
Completes #357. The no-symbol file-level class is yaml/twig/properties, but the count fix only covered yaml/twig — so a .properties-only project still printed "No files found to index" even though the files were stored. Introduce a single isFileLevelOnlyLanguage predicate (the canonical set behind the tree-sitter no-symbol branch, xml excluded since its MyBatis extractor emits a file node) and use it at both count sites and the extraction dispatch so the list can't drift. Adds .properties regression coverage for indexAll() and indexFiles(). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
839cf63dcb
commit
cdbf451440
@@ -3258,6 +3258,38 @@ export function multiply(a: number, b: number): number {
|
||||
|
||||
cg.close();
|
||||
});
|
||||
|
||||
it('should count file-level tracked .properties files as indexed', async () => {
|
||||
fs.writeFileSync(path.join(tempDir, 'application.properties'), 'server.port=8080\n');
|
||||
fs.writeFileSync(path.join(tempDir, 'log.properties'), 'log.level=INFO\n');
|
||||
|
||||
const cg = CodeGraph.initSync(tempDir);
|
||||
const result = await cg.indexAll();
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.filesIndexed).toBe(2);
|
||||
expect(result.filesSkipped).toBe(0);
|
||||
|
||||
cg.close();
|
||||
});
|
||||
|
||||
it('should count the full file-level tracked class (yaml/twig/properties) in indexFiles()', async () => {
|
||||
fs.writeFileSync(path.join(tempDir, 'app.yaml'), 'name: test\n');
|
||||
fs.writeFileSync(path.join(tempDir, 'view.twig'), '{{ title }}\n');
|
||||
fs.writeFileSync(path.join(tempDir, 'application.properties'), 'server.port=8080\n');
|
||||
|
||||
const cg = CodeGraph.initSync(tempDir);
|
||||
const result = await cg.indexFiles(['app.yaml', 'view.twig', 'application.properties']);
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.filesIndexed).toBe(3);
|
||||
expect(result.filesSkipped).toBe(0);
|
||||
|
||||
const tracked = cg.getFiles().map((f) => `${f.path}:${f.language}`).sort();
|
||||
expect(tracked).toEqual(['app.yaml:yaml', 'application.properties:properties', 'view.twig:twig']);
|
||||
|
||||
cg.close();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Path Normalization', () => {
|
||||
|
||||
Reference in New Issue
Block a user