MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / matchFailureSnippet

Function matchFailureSnippet

tools/builtin.go:1349–1377  ·  view source on GitHub ↗
(fileContent, oldString string)

Source from the content-addressed store, hash-verified

1347 return filepath.Clean(filepath.Join(parts...))
1348 }
1349 parent := filepath.Dir(current)
1350 if parent == current {
1351 return cleaned
1352 }
1353 suffix = append([]string{filepath.Base(current)}, suffix...)
1354 current = parent
1355 }
1356}
1357
1358func isBroadSearchRoot(path string) bool {
1359 resolved := resolvePathBestEffort(path)
1360 home, _ := os.UserHomeDir()
1361 volume := filepath.VolumeName(resolved)
1362 root := string(filepath.Separator)
1363 if volume != "" {
1364 root = volume + string(filepath.Separator)
1365 }
1366 parent := filepath.Dir(resolved)
1367 return filepath.Clean(resolved) == filepath.Clean(home) || filepath.Clean(resolved) == filepath.Clean(root) || parent == resolved
1368}
1369
1370var ignoredGlobDirs = map[string]struct{}{
1371 ".git": {}, "node_modules": {}, "__pycache__": {}, ".venv": {}, "venv": {}, ".tox": {}, ".mypy_cache": {}, ".pytest_cache": {},
1372}
1373
1374func hasIgnoredDir(path string) bool {
1375 for _, part := range strings.Split(filepath.ToSlash(path), "/") {
1376 if _, ok := ignoredGlobDirs[part]; ok {
1377 return true
1378 }
1379 }
1380 return false

Callers 1

ExecuteMethod · 0.85

Calls 2

lineSimilarityFunction · 0.85
truncateForMsgFunction · 0.85

Tested by

no test coverage detected