Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion internal/indexer/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (s *Scanner) scanFile(absPath, lang string) (ScannedFile, error) {
}

return ScannedFile{
Path: relPath,
Path: filepath.ToSlash(relPath),
AbsPath: absPath,
ContentHash: fmt.Sprintf("%x", hash),
Language: lang,
Expand Down
8 changes: 4 additions & 4 deletions internal/resolver/python/python.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (r *Resolver) DetectPackageRoots() ([]PackageRoot, error) {
if fileExists(filepath.Join(absSubdir, "pyproject.toml")) || fileExists(filepath.Join(absSubdir, "setup.py")) {
roots = appendIfNewPath(roots, PackageRoot{Path: subdir, DetectionMethod: "monorepo_subdir"})
if dirExists(filepath.Join(absSubdir, "src")) {
roots = appendIfNewPath(roots, PackageRoot{Path: filepath.Join(subdir, "src"), DetectionMethod: "src_layout"})
roots = appendIfNewPath(roots, PackageRoot{Path: filepath.ToSlash(filepath.Join(subdir, "src")), DetectionMethod: "src_layout"})
}
}
}
Expand Down Expand Up @@ -177,7 +177,7 @@ func (r *Resolver) resolveRelative(srcFile string, fact model.ImportFact) model.
}
}
// Check for __init__.py in the base dir itself.
initPath := filepath.Join(baseDir, "__init__.py")
initPath := filepath.ToSlash(filepath.Join(baseDir, "__init__.py"))
if fileExists(filepath.Join(r.repoRoot, initPath)) {
return model.ResolveResult{
ResolvedPath: initPath,
Expand Down Expand Up @@ -273,13 +273,13 @@ func resolveModulePath(repoRoot, base, modulePath string) string {
relPath := strings.ReplaceAll(modulePath, ".", string(filepath.Separator))

// Try as .py file.
pyFile := filepath.Join(base, relPath+".py")
pyFile := filepath.ToSlash(filepath.Join(base, relPath+".py"))
if fileExists(filepath.Join(repoRoot, pyFile)) {
return pyFile
}

// Try as package __init__.py.
initFile := filepath.Join(base, relPath, "__init__.py")
initFile := filepath.ToSlash(filepath.Join(base, relPath, "__init__.py"))
if fileExists(filepath.Join(repoRoot, initFile)) {
return initFile
}
Expand Down