From e5a796161c9fc3481a3682cce689cb6abcffcca0 Mon Sep 17 00:00:00 2001 From: MateuszKepczynskiSauce Date: Thu, 28 Nov 2024 12:27:08 +0100 Subject: [PATCH] fix(threads): fix sending just ")" when "..." are present (#26) --- threads.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/threads.go b/threads.go index 1f49f75..5c2387f 100644 --- a/threads.go +++ b/threads.go @@ -119,6 +119,13 @@ func readFileGetSourceCode(path string) SourceCode { } func getLastPathIndexAndFunction(line string) (int, string) { + if strings.HasSuffix(line, ")") { + lastIndex := strings.LastIndex(line, "(") + if lastIndex != -1 { + line = line[:lastIndex] + } + } + lastIndex := strings.LastIndex(line, ".") function, _, _ := strings.Cut(line[lastIndex+1:], "(") return lastIndex, function