kodit 0.3.3__py3-none-any.whl → 0.3.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kodit might be problematic. Click here for more details.
- kodit/_version.py +2 -2
- kodit/app.py +23 -4
- kodit/application/factories/code_indexing_factory.py +2 -24
- kodit/application/services/code_indexing_application_service.py +10 -2
- kodit/application/services/sync_scheduler.py +128 -0
- kodit/cli.py +103 -28
- kodit/config.py +15 -0
- kodit/domain/services/index_service.py +25 -66
- kodit/domain/value_objects.py +10 -22
- kodit/infrastructure/slicing/__init__.py +1 -0
- kodit/infrastructure/slicing/language_detection_service.py +18 -0
- kodit/infrastructure/slicing/slicer.py +894 -0
- kodit/infrastructure/sqlalchemy/index_repository.py +29 -0
- kodit/migrations/versions/4073b33f9436_add_file_processing_flag.py +6 -4
- kodit/migrations/versions/4552eb3f23ce_add_summary.py +4 -4
- kodit/migrations/versions/7c3bbc2ab32b_add_embeddings_table.py +24 -16
- kodit/migrations/versions/85155663351e_initial.py +64 -48
- kodit/migrations/versions/c3f5137d30f5_index_all_the_things.py +20 -14
- {kodit-0.3.3.dist-info → kodit-0.3.5.dist-info}/METADATA +10 -4
- {kodit-0.3.3.dist-info → kodit-0.3.5.dist-info}/RECORD +23 -32
- kodit/infrastructure/snippet_extraction/__init__.py +0 -1
- kodit/infrastructure/snippet_extraction/factories.py +0 -13
- kodit/infrastructure/snippet_extraction/language_detection_service.py +0 -39
- kodit/infrastructure/snippet_extraction/languages/csharp.scm +0 -12
- kodit/infrastructure/snippet_extraction/languages/go.scm +0 -26
- kodit/infrastructure/snippet_extraction/languages/java.scm +0 -12
- kodit/infrastructure/snippet_extraction/languages/javascript.scm +0 -24
- kodit/infrastructure/snippet_extraction/languages/python.scm +0 -22
- kodit/infrastructure/snippet_extraction/languages/typescript.scm +0 -25
- kodit/infrastructure/snippet_extraction/snippet_extraction_factory.py +0 -67
- kodit/infrastructure/snippet_extraction/snippet_query_provider.py +0 -44
- kodit/infrastructure/snippet_extraction/tree_sitter_snippet_extractor.py +0 -182
- kodit/infrastructure/sqlalchemy/file_repository.py +0 -78
- {kodit-0.3.3.dist-info → kodit-0.3.5.dist-info}/WHEEL +0 -0
- {kodit-0.3.3.dist-info → kodit-0.3.5.dist-info}/entry_points.txt +0 -0
- {kodit-0.3.3.dist-info → kodit-0.3.5.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Slicing infrastructure module."""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Language detection service implementation."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
from kodit.domain.services.index_service import LanguageDetectionService
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class FileSystemLanguageDetectionService(LanguageDetectionService):
|
|
9
|
+
"""Simple file extension based language detection service."""
|
|
10
|
+
|
|
11
|
+
def __init__(self, language_map: dict[str, str]) -> None:
|
|
12
|
+
"""Initialize with a mapping of extensions to languages."""
|
|
13
|
+
self._language_map = language_map
|
|
14
|
+
|
|
15
|
+
async def detect_language(self, file_path: Path) -> str:
|
|
16
|
+
"""Detect language based on file extension."""
|
|
17
|
+
extension = file_path.suffix.lstrip(".")
|
|
18
|
+
return self._language_map.get(extension, "unknown")
|