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

Function _remove_common_prefixes

tools/code_implementation_server.py:1094–1103  ·  view source on GitHub ↗

Remove common prefixes from file path

(file_path: str)

Source from the content-addressed store, hash-verified

1092
1093
1094def _remove_common_prefixes(file_path: str) -> str:
1095 """Remove common prefixes from file path"""
1096 prefixes_to_remove = ["src/", "core/", "./", "lib/", "main/"]
1097 path = file_path
1098
1099 for prefix in prefixes_to_remove:
1100 if path.startswith(prefix):
1101 path = path[len(prefix) :]
1102
1103 return path
1104
1105
1106def _extract_file_section_alternative(

Callers 1

_paths_matchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected