refactor: Extract per-language configs and standalone extractors from tree-sitter.ts
Splits the monolithic tree-sitter.ts (3,358 lines) into modular files: - 14 language config files under src/extraction/languages/ - 3 standalone extractors (Liquid, Svelte, DFM) - Shared helpers and types modules to avoid circular imports Also fixes a bug where Java's extractImport hook incorrectly set handledRefs: true, preventing unresolved reference creation and degrading codegraph_explore results for Java codebases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
0d63166f9d
commit
c8407ad007
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Per-language extraction configurations.
|
||||
*
|
||||
* Each file exports a LanguageExtractor config object.
|
||||
* This barrel builds the EXTRACTORS map consumed by TreeSitterExtractor.
|
||||
*/
|
||||
|
||||
import { Language } from '../../types';
|
||||
import type { LanguageExtractor } from '../tree-sitter-types';
|
||||
|
||||
import { typescriptExtractor } from './typescript';
|
||||
import { javascriptExtractor } from './javascript';
|
||||
import { pythonExtractor } from './python';
|
||||
import { goExtractor } from './go';
|
||||
import { rustExtractor } from './rust';
|
||||
import { javaExtractor } from './java';
|
||||
import { cExtractor, cppExtractor } from './c-cpp';
|
||||
import { csharpExtractor } from './csharp';
|
||||
import { phpExtractor } from './php';
|
||||
import { rubyExtractor } from './ruby';
|
||||
import { swiftExtractor } from './swift';
|
||||
import { kotlinExtractor } from './kotlin';
|
||||
import { dartExtractor } from './dart';
|
||||
import { pascalExtractor } from './pascal';
|
||||
|
||||
export const EXTRACTORS: Partial<Record<Language, LanguageExtractor>> = {
|
||||
typescript: typescriptExtractor,
|
||||
tsx: typescriptExtractor,
|
||||
javascript: javascriptExtractor,
|
||||
jsx: javascriptExtractor,
|
||||
python: pythonExtractor,
|
||||
go: goExtractor,
|
||||
rust: rustExtractor,
|
||||
java: javaExtractor,
|
||||
c: cExtractor,
|
||||
cpp: cppExtractor,
|
||||
csharp: csharpExtractor,
|
||||
php: phpExtractor,
|
||||
ruby: rubyExtractor,
|
||||
swift: swiftExtractor,
|
||||
kotlin: kotlinExtractor,
|
||||
dart: dartExtractor,
|
||||
pascal: pascalExtractor,
|
||||
};
|
||||
Reference in New Issue
Block a user