MCPcopy Create free account
hub / github.com/JordanCoin/codemap / tryExactMatch

Function tryExactMatch

scanner/filegraph.go:258–269  ·  view source on GitHub ↗

tryExactMatch looks for exact path matches with common extensions. Extension list derived from the canonical scanner registry.

(path string, idx *fileIndex)

Source from the content-addressed store, hash-verified

256// tryExactMatch looks for exact path matches with common extensions.
257// Extension list derived from the canonical scanner registry.
258func tryExactMatch(path string, idx *fileIndex) []string {
259 extensions := ResolverExtensions()
260
261 for _, ext := range extensions {
262 candidate := path + ext
263 if files, ok := idx.byExact[candidate]; ok {
264 return files
265 }
266 }
267
268 return nil
269}
270
271// trySuffixMatch finds files where the path ends with the normalized import
272func trySuffixMatch(normalized string, idx *fileIndex) []string {

Callers 3

fuzzyResolveFunction · 0.85
resolveRelativeFunction · 0.85
resolvePathAliasFunction · 0.85

Calls 1

ResolverExtensionsFunction · 0.85

Tested by

no test coverage detected