Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .custom-gcl.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/custom-gcl.jsonschema.json

version: v2.4.0
version: v2.5.0

destination: ./_tools

Expand Down
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND

---------------------------------------------------------

github.com/go-json-experiment/json v0.0.0-20250813233538-9b1f9ea2e11b - BSD-3-Clause
github.com/go-json-experiment/json v0.0.0-20250910080747-cc2cfa0554c3 - BSD-3-Clause


Copyright 2010 The Go Authors
Expand Down
4 changes: 2 additions & 2 deletions _extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
},
"devDependencies": {
"@types/vscode": "^1.100.0",
"@vscode/vsce": "^3.6.0",
"esbuild": "^0.25.8"
"@vscode/vsce": "^3.6.2",
"esbuild": "^0.25.10"
}
}
4 changes: 2 additions & 2 deletions _tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ go 1.25
require (
github.com/golangci/plugin-module-register v0.1.2
golang.org/x/mod v0.28.0
golang.org/x/tools v0.36.0
golang.org/x/tools v0.37.0
gotest.tools/v3 v3.5.2
)

require (
github.com/google/go-cmp v0.6.0 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/sync v0.17.0 // indirect
)
8 changes: 4 additions & 4 deletions _tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U=
golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI=
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE=
golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w=
gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.25

require (
github.com/dlclark/regexp2 v1.11.5
github.com/go-json-experiment/json v0.0.0-20250813233538-9b1f9ea2e11b
github.com/go-json-experiment/json v0.0.0-20250910080747-cc2cfa0554c3
github.com/google/go-cmp v0.7.0
github.com/peter-evans/patience v0.3.0
github.com/zeebo/xxh3 v1.0.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ=
github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/go-json-experiment/json v0.0.0-20250813233538-9b1f9ea2e11b h1:6Q4zRHXS/YLOl9Ng1b1OOOBWMidAQZR3Gel0UKPC/KU=
github.com/go-json-experiment/json v0.0.0-20250813233538-9b1f9ea2e11b/go.mod h1:TiCD2a1pcmjd7YnhGH0f/zKNcCD06B029pHhzV23c2M=
github.com/go-json-experiment/json v0.0.0-20250910080747-cc2cfa0554c3 h1:02WINGfSX5w0Mn+F28UyRoSt9uvMhKguwWMlOAh6U/0=
github.com/go-json-experiment/json v0.0.0-20250910080747-cc2cfa0554c3/go.mod h1:uNVvRXArCGbZ508SxYYTC5v1JWoz2voff5pm25jU1Ok=
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
Expand Down
36 changes: 18 additions & 18 deletions internal/testutil/harnessutil/sourcemap_recorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ type writerAggregator struct {
strings.Builder
}

func (w *writerAggregator) WriteStringF(format string, args ...any) {
func (w *writerAggregator) WriteStringf(format string, args ...any) {
w.WriteString(fmt.Sprintf(format, args...))
}

func (w *writerAggregator) WriteLine(s string) {
w.WriteString(s + "\r\n")
}

func (w *writerAggregator) WriteLineF(format string, args ...any) {
w.WriteStringF(format+"\r\n", args...)
func (w *writerAggregator) WriteLinef(format string, args ...any) {
w.WriteStringf(format+"\r\n", args...)
}

type sourceMapSpanWithDecodeErrors struct {
Expand Down Expand Up @@ -103,31 +103,31 @@ func newSourceMapSpanWriter(sourceMapRecorder *writerAggregator, sourceMap *sour
}

sourceMapRecorder.WriteLine("===================================================================")
sourceMapRecorder.WriteLineF("JsFile: %s", sourceMap.File)
sourceMapRecorder.WriteLineF("mapUrl: %s", sourcemap.TryGetSourceMappingURL(sourcemap.GetLineInfo(jsFile.Content, writer.jsLineMap)))
sourceMapRecorder.WriteLineF("sourceRoot: %s", sourceMap.SourceRoot)
sourceMapRecorder.WriteLineF("sources: %s", strings.Join(sourceMap.Sources, ","))
sourceMapRecorder.WriteLinef("JsFile: %s", sourceMap.File)
sourceMapRecorder.WriteLinef("mapUrl: %s", sourcemap.TryGetSourceMappingURL(sourcemap.GetLineInfo(jsFile.Content, writer.jsLineMap)))
sourceMapRecorder.WriteLinef("sourceRoot: %s", sourceMap.SourceRoot)
sourceMapRecorder.WriteLinef("sources: %s", strings.Join(sourceMap.Sources, ","))
if len(sourceMap.SourcesContent) > 0 {
content, err := json.Marshal(sourceMap.SourcesContent)
if err != nil {
panic(err)
}
sourceMapRecorder.WriteLineF("sourcesContent: %s", content)
sourceMapRecorder.WriteLinef("sourcesContent: %s", content)
}
sourceMapRecorder.WriteLine("===================================================================")
return writer
}

func (w *sourceMapSpanWriter) getSourceMapSpanString(mapEntry *sourcemap.Mapping, getAbsentNameIndex bool) string {
var mapString writerAggregator
mapString.WriteStringF("Emitted(%d, %d)", mapEntry.GeneratedLine+1, mapEntry.GeneratedCharacter+1)
mapString.WriteStringf("Emitted(%d, %d)", mapEntry.GeneratedLine+1, mapEntry.GeneratedCharacter+1)
if mapEntry.IsSourceMapping() {
mapString.WriteStringF(" Source(%d, %d) + SourceIndex(%d)", mapEntry.SourceLine+1, mapEntry.SourceCharacter+1, mapEntry.SourceIndex)
mapString.WriteStringf(" Source(%d, %d) + SourceIndex(%d)", mapEntry.SourceLine+1, mapEntry.SourceCharacter+1, mapEntry.SourceIndex)
if mapEntry.NameIndex >= 0 && int(mapEntry.NameIndex) < len(w.sourceMapNames) {
mapString.WriteStringF(" name (%s)", w.sourceMapNames[mapEntry.NameIndex])
mapString.WriteStringf(" name (%s)", w.sourceMapNames[mapEntry.NameIndex])
} else {
if mapEntry.NameIndex != sourcemap.MissingName || getAbsentNameIndex {
mapString.WriteStringF(" nameIndex (%d)", mapEntry.NameIndex)
mapString.WriteStringf(" nameIndex (%d)", mapEntry.NameIndex)
}
}
}
Expand Down Expand Up @@ -180,11 +180,11 @@ func (w *sourceMapSpanWriter) recordNewSourceFileSpan(sourceMapSpan *sourcemap.M

w.sourceMapRecorder.WriteLine("-------------------------------------------------------------------")
if continuesLine {
w.sourceMapRecorder.WriteLineF("emittedFile:%s (%d, %d)", w.jsFile.UnitName, sourceMapSpan.GeneratedLine+1, sourceMapSpan.GeneratedCharacter+1)
w.sourceMapRecorder.WriteLinef("emittedFile:%s (%d, %d)", w.jsFile.UnitName, sourceMapSpan.GeneratedLine+1, sourceMapSpan.GeneratedCharacter+1)
} else {
w.sourceMapRecorder.WriteLineF("emittedFile:%s", w.jsFile.UnitName)
w.sourceMapRecorder.WriteLinef("emittedFile:%s", w.jsFile.UnitName)
}
w.sourceMapRecorder.WriteLineF("sourceFile:%s", w.sourceMapSources[w.spansOnSingleLine[0].sourceMapSpan.SourceIndex])
w.sourceMapRecorder.WriteLinef("sourceFile:%s", w.sourceMapSources[w.spansOnSingleLine[0].sourceMapSpan.SourceIndex])
w.sourceMapRecorder.WriteLine("-------------------------------------------------------------------")

w.tsLineMap = core.ComputeLineStarts(newSourceFileCode)
Expand All @@ -198,7 +198,7 @@ func (w *sourceMapSpanWriter) close() {

if !w.sourceMapDecoder.hasCompletedDecoding() {
w.sourceMapRecorder.WriteLine("!!!! **** There are more source map entries in the sourceMap's mapping than what was encoded")
w.sourceMapRecorder.WriteLineF("!!!! **** Remaining decoded string: %s", w.sourceMapDecoder.getRemainingDecodeString())
w.sourceMapRecorder.WriteLinef("!!!! **** Remaining decoded string: %s", w.sourceMapDecoder.getRemainingDecodeString())
}

// write remaining js lines
Expand All @@ -223,7 +223,7 @@ func (w *sourceMapSpanWriter) getTextOfLine(line int, lineMap []core.TextPos, co

func (w *sourceMapSpanWriter) writeJsFileLines(endJsLine int) {
for ; w.nextJsLineToWrite < endJsLine; w.nextJsLineToWrite++ {
w.sourceMapRecorder.WriteStringF(">>>%s", w.getTextOfLine(w.nextJsLineToWrite, w.jsLineMap, w.jsFile.Content))
w.sourceMapRecorder.WriteStringf(">>>%s", w.getTextOfLine(w.nextJsLineToWrite, w.jsLineMap, w.jsFile.Content))
}
}

Expand Down Expand Up @@ -319,7 +319,7 @@ func (sw *recordedSpanWriter) writeSourceMapSourceText(currentSpan *sourceMapSpa
}

func (sw *recordedSpanWriter) writeSpanDetails(currentSpan *sourceMapSpanWithDecodeErrors, index int) {
sw.w.sourceMapRecorder.WriteLineF("%s%s", sw.markerIds[index], sw.w.getSourceMapSpanString(currentSpan.sourceMapSpan, false /*getAbsentNameIndex*/))
sw.w.sourceMapRecorder.WriteLinef("%s%s", sw.markerIds[index], sw.w.getSourceMapSpanString(currentSpan.sourceMapSpan, false /*getAbsentNameIndex*/))
}

func (sw *recordedSpanWriter) writeRecordedSpans() {
Expand Down
Loading