From 8c7c563df4fa915403eb25cd758307095ea0c531 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 21:19:29 +0000 Subject: [PATCH 1/2] deps(deps): bump microsoft/typescript-go from `c15e764` to `d9178cc` Bumps [microsoft/typescript-go](https://github.com/microsoft/typescript-go) from `c15e764` to `d9178cc`. - [Commits](https://github.com/microsoft/typescript-go/compare/c15e7649ca152ac52d424558abae7addd3f43801...d9178cc1fef3cedc3c1a48a652e63dd83310ea20) --- updated-dependencies: - dependency-name: microsoft/typescript-go dependency-version: d9178cc1fef3cedc3c1a48a652e63dd83310ea20 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- microsoft/typescript-go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microsoft/typescript-go b/microsoft/typescript-go index c15e7649..d9178cc1 160000 --- a/microsoft/typescript-go +++ b/microsoft/typescript-go @@ -1 +1 @@ -Subproject commit c15e7649ca152ac52d424558abae7addd3f43801 +Subproject commit d9178cc1fef3cedc3c1a48a652e63dd83310ea20 From 20dfdf2cc22afb7a28c41aeca6b7327316aaa759 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 20 Dec 2025 19:00:43 +0800 Subject: [PATCH 2/2] chore(sync): mirror internal packages into pkg/ (auto) (#64) Co-authored-by: buke <1013738+buke@users.noreply.github.com> --- pkg/checker/checker.go | 12 ++++++------ pkg/pprof/pprof.go | 11 ----------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/pkg/checker/checker.go b/pkg/checker/checker.go index 97d7cfc0..5e5f08de 100644 --- a/pkg/checker/checker.go +++ b/pkg/checker/checker.go @@ -2302,8 +2302,8 @@ func (c *Checker) checkSourceElementUnreachable(node *ast.Node) bool { sourceFile := ast.GetSourceFileOfNode(node) - start := node.Pos() - end := node.End() + startNode := node + endNode := node parent := node.Parent if parent.CanHaveStatements() { @@ -2333,14 +2333,14 @@ func (c *Checker) checkSourceElementUnreachable(node *ast.Node) bool { c.reportedUnreachableNodes.Add(nextNode) } - start = statements[first].Pos() - end = statements[last].End() + startNode = statements[first] + endNode = statements[last] } } - start = scanner.SkipTrivia(sourceFile.Text(), start) + start := scanner.GetTokenPosOfNode(startNode, sourceFile, false /*includeJSDoc*/) - diagnostic := ast.NewDiagnostic(sourceFile, core.NewTextRange(start, end), diagnostics.Unreachable_code_detected) + diagnostic := ast.NewDiagnostic(sourceFile, core.NewTextRange(start, endNode.End()), diagnostics.Unreachable_code_detected) c.addErrorOrSuggestion(c.compilerOptions.AllowUnreachableCode == core.TSFalse, diagnostic) return true diff --git a/pkg/pprof/pprof.go b/pkg/pprof/pprof.go index 554e7110..2523c948 100644 --- a/pkg/pprof/pprof.go +++ b/pkg/pprof/pprof.go @@ -6,8 +6,6 @@ import ( "os" "path/filepath" "runtime/pprof" - - "github.com/buke/typescript-go-internal/pkg/repo" ) type ProfileSession struct { @@ -63,12 +61,3 @@ func (p *ProfileSession) Stop() { fmt.Fprintf(p.logWriter, "CPU profile: %v\n", p.cpuFilePath) fmt.Fprintf(p.logWriter, "Memory profile: %v\n", p.memFilePath) } - -// ProfileInPprofDir is a convenience function that starts profiling in the 'pprof' directory under the repository root. -// The resulting files are logged to stderr. It returns a function that stops the profiling when called. -func ProfileInPprofDir() func() { - session := BeginProfiling(filepath.Join(repo.RootPath, "pprof"), os.Stderr) - return func() { - session.Stop() - } -}