Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/mcp_codebase_index/project_indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def index(self) -> ProjectIndex:
total_classes = 0

for fpath in file_paths:
rel_path = os.path.relpath(fpath, self.root_path)
rel_path = os.path.relpath(fpath, self.root_path).replace(os.sep, "/")
try:
source = self._read_file(fpath)
except (OSError, UnicodeDecodeError) as e:
Expand Down Expand Up @@ -188,7 +188,7 @@ def reindex_file(self, file_path: str, skip_graph_rebuild: bool = False) -> None
if os.path.isabs(file_path)
else os.path.join(self.root_path, file_path)
)
rel_path = os.path.relpath(abs_path, self.root_path)
rel_path = os.path.relpath(abs_path, self.root_path).replace(os.sep, "/")

idx = self._project_index

Expand Down Expand Up @@ -281,7 +281,7 @@ def remove_file(self, file_path: str) -> None:
if os.path.isabs(file_path)
else os.path.join(self.root_path, file_path)
)
rel_path = os.path.relpath(abs_path, self.root_path)
rel_path = os.path.relpath(abs_path, self.root_path).replace(os.sep, "/")

idx = self._project_index
old_metadata = idx.files.get(rel_path)
Expand Down Expand Up @@ -344,7 +344,7 @@ def _discover_files(self) -> list[str]:
for p in root.glob(pattern):
if p.is_file():
abs_str = str(p)
rel_str = os.path.relpath(abs_str, self.root_path)
rel_str = os.path.relpath(abs_str, self.root_path).replace(os.sep, "/")

if self._is_excluded(rel_str):
continue
Expand Down