MCPcopy Index your code
hub / github.com/HKUDS/DeepCode / _normalize_file_path

Function _normalize_file_path

tools/code_implementation_server.py:1038–1052  ·  view source on GitHub ↗

Normalize file path for comparison

(file_path: str)

Source from the content-addressed store, hash-verified

1036
1037
1038def _normalize_file_path(file_path: str) -> str:
1039 """Normalize file path for comparison"""
1040 # Remove leading/trailing slashes and convert to lowercase
1041 normalized = file_path.strip("/").lower()
1042 # Replace backslashes with forward slashes
1043 normalized = normalized.replace("\\", "/")
1044
1045 # Remove common prefixes to make matching more flexible
1046 common_prefixes = ["src/", "./src/", "./", "core/", "lib/", "main/"]
1047 for prefix in common_prefixes:
1048 if normalized.startswith(prefix):
1049 normalized = normalized[len(prefix) :]
1050 break
1051
1052 return normalized
1053
1054
1055def _paths_match(

Calls

no outgoing calls

Tested by

no test coverage detected