wakatime/wakatime-cli

panic: runtime error: slice bounds out of range [:-1]

alanhamlett opened this issue · 0 comments

Environment

  • OS: Windows amd64
  • CLI: v1.74.1

Stacktrace

goroutine 1 [running]:
runtime/debug.Stack()
 /opt/hostedtoolcache/go/1.19.6/x64/src/runtime/debug/stack.go:24 +0x65
github.com/wakatime/wakatime-cli/cmd.runCmd.func1()
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/run.go:272 +0xd3
panic({0xc5b8e0, 0xc000026390})
 /opt/hostedtoolcache/go/1.19.6/x64/src/runtime/panic.go:884 +0x212
github.com/alecthomas/chroma/lexers/h.haxePreProcMutator(0xc00013a2c0)
 /home/runner/go/pkg/mod/github.com/wakatime/chroma@v0.10.0-wakatime.1/lexers/h/haxe.go:634 +0x525
github.com/alecthomas/chroma.MutatorFunc.Mutate(0xc00058a090?, 0x32b8?)
 /home/runner/go/pkg/mod/github.com/wakatime/chroma@v0.10.0-wakatime.1/mutators.go:24 +0x1f
github.com/alecthomas/chroma.(*LexerState).Iterator(0xc00013a2c0)
 /home/runner/go/pkg/mod/github.com/wakatime/chroma@v0.10.0-wakatime.1/regexp.go:370 +0x3a2
github.com/alecthomas/chroma.Iterator.Tokens(0xc000460fb0)
 /home/runner/go/pkg/mod/github.com/wakatime/chroma@v0.10.0-wakatime.1/iterator.go:15 +0x4b
github.com/wakatime/wakatime-cli/pkg/deps.(*ParserHaxe).Parse(0xc000372380, {0xc00051c540, 0x55})
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/deps/haxe.go:61 +0x22e
github.com/wakatime/wakatime-cli/pkg/deps.Detect({0xc00051c540, 0x55}, 0x0?)
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/deps/deps.go:127 +0x3a5
github.com/wakatime/wakatime-cli/pkg/deps.WithDetection.func1.1({0xc00036e360, 0x1, 0x1})
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/deps/deps.go:68 +0x350
github.com/wakatime/wakatime-cli/pkg/language.WithDetection.func1.1({0xc00036e360, 0x1, 0x1})
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/language/language.go:48 +0xb8
github.com/wakatime/wakatime-cli/pkg/filestats.WithDetection.func1.1({0xc00036e360, 0x1, 0x1})
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/filestats/filestats.go:72 +0xbf
github.com/wakatime/wakatime-cli/pkg/apikey.WithReplacing.func1.1({0xc00036e360, 0x1, 0x1})
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/apikey/apikey.go:42 +0xbc
github.com/wakatime/wakatime-cli/pkg/remote.WithDetection.func1.1({0xc00036e240, 0x1, 0x0?})
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/remote/remote.go:103 +0xc2
github.com/wakatime/wakatime-cli/pkg/filter.WithFiltering.func1.1({0xc0000d8000, 0x1, 0xc0001169c8?})
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/filter/filter.go:41 +0xc2
github.com/wakatime/wakatime-cli/pkg/heartbeat.WithEntityModifer.func1.1({0xc0000d8000, 0x1, 0x1})
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/heartbeat/entity_modify.go:24 +0xb8
github.com/wakatime/wakatime-cli/pkg/heartbeat.WithFormatting.func1.1({0xc0000d8000, 0x1, 0x1})
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/heartbeat/format.go:32 +0xbf
github.com/wakatime/wakatime-cli/pkg/heartbeat.NewHandle.func1({0xc0000d8000, 0x1, 0x1})
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/heartbeat/heartbeat.go:168 +0xd1
github.com/wakatime/wakatime-cli/cmd/heartbeat.SendHeartbeats(0xc00024e680, {0xc00008c1a0, 0x1c})
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/heartbeat/heartbeat.go:123 +0x77b
github.com/wakatime/wakatime-cli/cmd/heartbeat.Run(0xe65760?)
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/heartbeat/heartbeat.go:36 +0xce
github.com/wakatime/wakatime-cli/cmd.runCmd(0xc00024e680, 0x0, 0x0, 0xd65a10)
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/run.go:288 +0x122
github.com/wakatime/wakatime-cli/cmd.RunCmdWithOfflineSync(0xc0000f0c60?, 0x11?, 0x86?, 0x0?)
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/run.go:246 +0x26
github.com/wakatime/wakatime-cli/cmd.Run(0x0?, 0x0?)
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/run.go:116 +0x5d7
github.com/wakatime/wakatime-cli/cmd.NewRootCMD.func1(0xc00037a000?, {0xc92ce8?, 0x13?, 0x1f?})
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/root.go:29 +0x1d
github.com/spf13/cobra.(*Command).execute(0xc00037a000, {0xc000122010, 0x13, 0x1f})
 /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0xc00037a000)
 /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
 /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/wakatime/wakatime-cli/cmd.Execute()
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/root.go:260 +0x1e
main.main()
 /home/runner/work/wakatime-cli/wakatime-cli/main.go:6 +0x17