MCPcopy
hub / github.com/MadAppGang/dingo / goToDingoPathWithConfig

Function goToDingoPathWithConfig

pkg/lsp/translator.go:327–340  ·  view source on GitHub ↗

goToDingoPathWithConfig converts a .go path to its .dingo source path using config.

(goPath string, cfg *config.Config)

Source from the content-addressed store, hash-verified

325
326// goToDingoPathWithConfig converts a .go path to its .dingo source path using config.
327func goToDingoPathWithConfig(goPath string, cfg *config.Config) string {
328 if !strings.HasSuffix(goPath, ".go") {
329 return goPath
330 }
331
332 // Use unified path calculation
333 dingoPath, err := transpiler.GoPathToDingoPath(goPath, cfg)
334 if err != nil {
335 // Fallback to simple suffix replacement if calculation fails
336 log.Printf("[LSP Translator] goToDingoPath: calculation failed for %s: %v, using fallback", goPath, err)
337 return strings.TrimSuffix(goPath, ".go") + ".dingo"
338 }
339 return dingoPath
340}
341
342// expandTabsInColumn adjusts a column position from Go (tabs) to Dingo (spaces).
343// Go files use tabs for indentation, Dingo files use 4 spaces.

Callers 2

TranslatePositionMethod · 0.85
goToDingoPathFunction · 0.85

Calls 2

GoPathToDingoPathFunction · 0.92
PrintfMethod · 0.80

Tested by

no test coverage detected