mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-05 16:13:08 +08:00
codex-lens: add Swift (.swift) indexing support
This commit is contained in:
@@ -216,6 +216,7 @@ def _detect_language(file_path: Path) -> str:
|
||||
".go": "go",
|
||||
".rs": "rust",
|
||||
".java": "java",
|
||||
".swift": "swift",
|
||||
".c": "c",
|
||||
".cpp": "cpp",
|
||||
".h": "c",
|
||||
|
||||
@@ -80,6 +80,7 @@ class Config:
|
||||
"go": {"extensions": [".go"], "tree_sitter_language": "go", "category": "code"},
|
||||
"zig": {"extensions": [".zig"], "tree_sitter_language": "zig", "category": "code"},
|
||||
"objective-c": {"extensions": [".m", ".mm"], "tree_sitter_language": "objc", "category": "code"},
|
||||
"swift": {"extensions": [".swift"], "tree_sitter_language": "swift", "category": "code"},
|
||||
"c": {"extensions": [".c", ".h"], "tree_sitter_language": "c", "category": "code"},
|
||||
"cpp": {"extensions": [".cc", ".cpp", ".hpp", ".cxx"], "tree_sitter_language": "cpp", "category": "code"},
|
||||
"rust": {"extensions": [".rs"], "tree_sitter_language": "rust", "category": "code"},
|
||||
|
||||
@@ -180,9 +180,18 @@ class TestConfig:
|
||||
assert "typescript" in config.supported_languages
|
||||
assert "java" in config.supported_languages
|
||||
assert "go" in config.supported_languages
|
||||
assert "swift" in config.supported_languages
|
||||
finally:
|
||||
del os.environ["CODEXLENS_DATA_DIR"]
|
||||
|
||||
def test_language_for_path_swift(self):
|
||||
"""Swift (.swift) files should be recognized as code."""
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
config = Config(data_dir=Path(tmpdir))
|
||||
assert config.language_for_path("x.swift") == "swift"
|
||||
assert config.language_for_path("X.SWIFT") == "swift"
|
||||
assert config.category_for_path("x.swift") == "code"
|
||||
|
||||
def test_cache_dir_property(self):
|
||||
"""Test cache_dir property."""
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
|
||||
Reference in New Issue
Block a user