MCPcopy Create free account
hub / github.com/apache/devlake / countOpenFiles

Function countOpenFiles

backend/plugins/q_dev/tasks/s3_logging_extractor.go:364–375  ·  view source on GitHub ↗

countOpenFiles counts tags within block

(prompt string)

Source from the content-addressed store, hash-verified

362
363// countOpenFiles counts <file name="..."> tags within <OPEN-EDITOR-FILES> block
364func countOpenFiles(prompt string) int {
365 start := strings.Index(prompt, "<OPEN-EDITOR-FILES>")
366 if start == -1 {
367 return 0
368 }
369 end := strings.Index(prompt, "</OPEN-EDITOR-FILES>")
370 if end == -1 {
371 return 0
372 }
373 block := prompt[start:end]
374 return strings.Count(block, "<file name=")
375}
376
377// parseActiveFile extracts the active file name and extension from prompt
378func parseActiveFile(prompt string) (string, string) {

Callers 1

parseChatRecordFunction · 0.85

Calls 1

CountMethod · 0.65

Tested by

no test coverage detected