From 7acb0a91f38ef3c1b97fd684cbe541ee5fe98b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Henrique=20Guard=C3=A3o=20Gandarez?= Date: Mon, 16 Sep 2024 17:13:47 -0300 Subject: [PATCH] Bump Chroma to v2.10.0 --- go.mod | 7 ++++--- go.sum | 8 ++++---- pkg/deps/java.go | 6 +++--- pkg/heartbeat/language.go | 14 ++++++++++++++ pkg/heartbeat/language_test.go | 2 ++ 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 4d75703e..6ff11ba1 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.5 require ( github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 github.com/alecthomas/assert v1.0.0 - github.com/alecthomas/chroma/v2 v2.9.1 + github.com/alecthomas/chroma/v2 v2.10.0 github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 github.com/dlclark/regexp2 v1.10.0 github.com/gandarez/go-olson-timezone v0.1.0 @@ -30,7 +30,7 @@ require ( require ( github.com/alecthomas/colour v0.1.0 // indirect - github.com/alecthomas/repr v0.2.0 // indirect + github.com/alecthomas/repr v0.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -55,6 +55,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/alecthomas/chroma/v2 => github.com/gandarez/chroma/v2 v2.9.1-wakatime.1 +// replace github.com/alecthomas/chroma/v2 => github.com/gandarez/chroma/v2 v2.9.1-wakatime.1 +// replace github.com/alecthomas/chroma/v2 => /Users/gandarez/development/git/gandarez/chroma replace github.com/matishsiao/goInfo => github.com/wakatime/goInfo v0.1.0-wakatime.9 diff --git a/go.sum b/go.sum index 8fa79d49..aa425f6b 100644 --- a/go.sum +++ b/go.sum @@ -44,10 +44,12 @@ github.com/alecthomas/assert v1.0.0 h1:3XmGh/PSuLzDbK3W2gUbRXwgW5lqPkuqvRgeQ30FI github.com/alecthomas/assert v1.0.0/go.mod h1:va/d2JC+M7F6s+80kl/R3G7FUiW6JzUO+hPhLyJ36ZY= github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink= github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= +github.com/alecthomas/chroma/v2 v2.10.0 h1:T2iQOCCt4pRmRMfL55gTodMtc7cU0y7lc1Jb8/mK/64= +github.com/alecthomas/chroma/v2 v2.10.0/go.mod h1:4TQu7gdfuPjSh76j78ietmqh9LiurGF0EpseFXdKMBw= github.com/alecthomas/colour v0.1.0 h1:nOE9rJm6dsZ66RGWYSFrXw461ZIt9A6+nHgL7FRrDUk= github.com/alecthomas/colour v0.1.0/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= -github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= -github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= +github.com/alecthomas/repr v0.3.0 h1:NeYzUPfjjlqHY4KtzgKJiWd6sVq2eNUPTi34PiFGjY8= +github.com/alecthomas/repr v0.3.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -75,8 +77,6 @@ github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0X github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gandarez/chroma/v2 v2.9.1-wakatime.1 h1:czvEuO+JRT4y2HTTh0REP0p0ebfleH6eY70UI0WF4OQ= -github.com/gandarez/chroma/v2 v2.9.1-wakatime.1/go.mod h1:4TQu7gdfuPjSh76j78ietmqh9LiurGF0EpseFXdKMBw= github.com/gandarez/go-olson-timezone v0.1.0 h1:cDRlHKQE0uC3mJNZyKoQIpAuvQtV8KXwIVj8bDEEyuo= github.com/gandarez/go-olson-timezone v0.1.0/go.mod h1:+yV/cYNjgs2JqdGShznAD4R13r8lKMGR2XlWAJqa5Yo= github.com/gandarez/go-realpath v1.0.0 h1:fhQBRDshH/MZNmDLWM9vbBameK2fxyLr+ctqkRwbHEU= diff --git a/pkg/deps/java.go b/pkg/deps/java.go index 12b05f3b..dc1f13fe 100644 --- a/pkg/deps/java.go +++ b/pkg/deps/java.go @@ -102,8 +102,8 @@ func (p *ParserJava) processToken(token chroma.Token) { p.processNameAttribute(token.Value) case chroma.NameNamespace: p.processNameNamespace(token.Value) - case chroma.Operator: - p.processOperator(token.Value) + case chroma.Punctuation: + p.processPunctuation(token.Value) } } @@ -170,7 +170,7 @@ func (p *ParserJava) processNameNamespace(value string) { } } -func (p *ParserJava) processOperator(value string) { +func (p *ParserJava) processPunctuation(value string) { if value == ";" { p.State = StateJavaImportFinished p.processKeywordNamespace(p.Buffer) diff --git a/pkg/heartbeat/language.go b/pkg/heartbeat/language.go index 7d586992..04487846 100644 --- a/pkg/heartbeat/language.go +++ b/pkg/heartbeat/language.go @@ -319,6 +319,8 @@ const ( LanguageCSV // LanguageCUDA represents the CUDA programming language. LanguageCUDA + // LanguageCUE represents the CUE programming language. + LanguageCUE // LanguagecURLConfig represents the cURLConfig programming language. LanguagecURLConfig // LanguageCVS represents the CVS programming language. @@ -1061,6 +1063,8 @@ const ( LanguagePromQL // LanguageProtocolBuffer represents the ProtocolBuffer programming language. LanguageProtocolBuffer + // LanguagePRQL represents the PRQL programming language. + LanguagePRQL // LanguagePSL represents the Property Specification Language programming language. LanguagePSL // LanguagePsyShPHP represents the PHPPsySH programming language. @@ -1728,6 +1732,7 @@ const ( languageCSSStr = "CSS" languageCSVStr = "CSV" languageCUDAStr = "Cuda" + languageCUEStr = "CUE" languagecURLConfigStr = "cURL Config" languageCVSStr = "CVS" languageCWebStr = "CWeb" @@ -2098,6 +2103,7 @@ const ( languagePrologStr = "Prolog" languagePromQLStr = "PromQL" languageProtocolBufferStr = "Protocol Buffer" + languagePRQLStr = "PRQL" languagePSLStr = "Property Specification Language" languagePsyShPHPStr = "PsySH console session for PHP" languagePugStr = "Pug" @@ -2723,6 +2729,8 @@ func ParseLanguage(s string) (Language, bool) { return LanguageCSV, true case normalizeString(languageCUDAStr): return LanguageCUDA, true + case normalizeString(languageCUEStr): + return LanguageCUE, true case normalizeString(languagecURLConfigStr): return LanguagecURLConfig, true case normalizeString(languageCVSStr): @@ -3463,6 +3471,8 @@ func ParseLanguage(s string) (Language, bool) { return LanguagePromQL, true case normalizeString(languageProtocolBufferStr): return LanguageProtocolBuffer, true + case normalizeString(languagePRQLStr): + return LanguagePRQL, true case normalizeString(languagePSLStr): return LanguagePSL, true case normalizeString(languagePsyShPHPStr): @@ -4411,6 +4421,8 @@ func (l Language) String() string { return languageCSVStr case LanguageCUDA: return languageCUDAStr + case LanguageCUE: + return languageCUEStr case LanguagecURLConfig: return languagecURLConfigStr case LanguageCVS: @@ -5149,6 +5161,8 @@ func (l Language) String() string { return languagePromQLStr case LanguageProtocolBuffer: return languageProtocolBufferStr + case LanguagePRQL: + return languagePRQLStr case LanguagePsyShPHP: return languagePsyShPHPStr case LanguagePug: diff --git a/pkg/heartbeat/language_test.go b/pkg/heartbeat/language_test.go index 226f2314..bba94067 100644 --- a/pkg/heartbeat/language_test.go +++ b/pkg/heartbeat/language_test.go @@ -168,6 +168,7 @@ func languageTests() map[string]heartbeat.Language { "CSS": heartbeat.LanguageCSS, "CSV": heartbeat.LanguageCSV, "Cuda": heartbeat.LanguageCUDA, + "CUE": heartbeat.LanguageCUE, "cURL Config": heartbeat.LanguagecURLConfig, "CVS": heartbeat.LanguageCVS, "CWeb": heartbeat.LanguageCWeb, @@ -537,6 +538,7 @@ func languageTests() map[string]heartbeat.Language { "PromQL": heartbeat.LanguagePromQL, "Property Specification Language": heartbeat.LanguagePSL, "Protocol Buffer": heartbeat.LanguageProtocolBuffer, + "PRQL": heartbeat.LanguagePRQL, "PsySH console session for PHP": heartbeat.LanguagePsyShPHP, "Pug": heartbeat.LanguagePug, "Puppet": heartbeat.LanguagePuppet,