Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .changeset/update-typescript-go-551b02d.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/tsgo": patch
---

Update the pinned TypeScript-Go submodule to `551b02d6c10e78610fc5ca7c23b77c9d531ee59b` and refresh generated shims.
9 changes: 4 additions & 5 deletions _patches/001-cmd-tsgo-main.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
diff --git a/cmd/tsgo/main.go b/cmd/tsgo/main.go
index a2fe02e8c..10044042c 100644
index 8d6816fa3d..49c6cbecba 100644
--- a/cmd/tsgo/main.go
+++ b/cmd/tsgo/main.go
@@ -3,6 +3,12 @@ package main
import (
"os"
@@ -6,6 +6,12 @@ import (
"os/signal"
"syscall"

+ // Import Effect hooks to register via init()
+ _ "github.com/effect-ts/tsgo/etsapihooks" // native API hooks
Expand All @@ -15,4 +15,3 @@ index a2fe02e8c..10044042c 100644
"github.com/microsoft/typescript-go/internal/core"
"github.com/microsoft/typescript-go/internal/execute"
)

8 changes: 4 additions & 4 deletions _patches/009-execute-tsc-emit.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/internal/execute/tsc.go b/internal/execute/tsc.go
index 385ceba18..72ee9639f 100644
index 80a9bdac9..8ac89fa6d 100644
--- a/internal/execute/tsc.go
+++ b/internal/execute/tsc.go
@@ -5,6 +5,7 @@ import (
Expand All @@ -10,18 +10,18 @@ index 385ceba18..72ee9639f 100644
"github.com/microsoft/typescript-go/internal/ast"
"github.com/microsoft/typescript-go/internal/collections"
"github.com/microsoft/typescript-go/internal/compiler"
@@ -50,6 +51,9 @@ func stopTracing(sys tsc.System, tr *tracing.Tracing) {
@@ -49,6 +50,9 @@ func stopTracing(sys tsc.System, tr *tracing.Tracing) {
}

func CommandLine(sys tsc.System, commandLineArgs []string, testing tsc.CommandLineTesting) tsc.CommandLineResult {
func CommandLine(ctx context.Context, sys tsc.System, commandLineArgs []string, testing tsc.CommandLineTesting) tsc.CommandLineResult {
+ restore := etscore.EnterCommandLineMode()
+ defer restore()
+
if len(commandLineArgs) > 0 {
switch strings.ToLower(commandLineArgs[0]) {
case "-b", "--b", "-build", "--build":
diff --git a/internal/execute/tsc/emit.go b/internal/execute/tsc/emit.go
index 16080d1f8..9286d1e95 100644
index 3a1e3de69..8cb7c24c0 100644
--- a/internal/execute/tsc/emit.go
+++ b/internal/execute/tsc/emit.go
@@ -10,6 +10,7 @@ import (
Expand Down
8 changes: 5 additions & 3 deletions _patches/022-ls-completions.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/internal/ls/completions.go b/internal/ls/completions.go
index 9c27bfe08..0f3d03446 100644
index f7d1c9f84..23d100dbb 100644
--- a/internal/ls/completions.go
+++ b/internal/ls/completions.go
@@ -31,13 +31,25 @@ import (
Expand Down Expand Up @@ -29,10 +29,12 @@ index 9c27bfe08..0f3d03446 100644
var triggerCharacter *string
if context != nil {
triggerCharacter = context.TriggerCharacter
@@ -53,6 +65,21 @@ func (l *LanguageService) ProvideCompletion(
@@ -54,6 +66,22 @@ func (l *LanguageService) ProvideCompletion(
if err != nil {
return lsproto.CompletionItemsOrListOrNull{}, err
}
- completionList := ensureItemData(file.FileName(), position, completionListInternal.toLSP())
+ completionList := completionListInternal.toLSP()
+ // EFFECT HOOK: Allow Effect to add or modify completion items
+ if AfterCompletionCallback != nil {
+ var existingItems []*lsproto.CompletionItem
Expand All @@ -48,6 +50,6 @@ index 9c27bfe08..0f3d03446 100644
+ }
+ }
+
completionList = ensureItemData(file.FileName(), position, completionList)
+ completionList = ensureItemData(file.FileName(), position, completionList)
return lsproto.CompletionItemsOrListOrNull{List: completionList}, nil
}
4 changes: 1 addition & 3 deletions _patches/028-api-effect-diagnostics.patch
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ diff --git a/internal/api/session.go b/internal/api/session.go
case string(MethodGetSuggestionDiagnostics):
return s.handleGetSuggestionDiagnostics(ctx, parsed.(*GetDiagnosticsParams))
case string(MethodGetDeclarationDiagnostics):
@@ -2003,6 +2015,40 @@ func (s *Session) handleGetSemanticDiagnostics(ctx context.Context, params *GetD
@@ -2169,4 +2181,38 @@ func (s *Session) handleGetSemanticDiagnostics(ctx context.Context, params *GetD
return NewDiagnosticResponses(diags), nil
}

Expand Down Expand Up @@ -116,5 +116,3 @@ diff --git a/internal/api/session.go b/internal/api/session.go
+}
+
// handleGetSuggestionDiagnostics returns suggestion diagnostics for a file or all files.
func (s *Session) handleGetSuggestionDiagnostics(ctx context.Context, params *GetDiagnosticsParams) ([]*DiagnosticResponse, error) {
sd, err := s.getSnapshotData(params.Snapshot)
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/* Source of truth: git submodule `typescript-go` commit.
Keep in sync via `_tools/update-flake-vendor-hash.sh`. */
typescript-go-src = {
url = "github:microsoft/typescript-go/f20e9196e66c08fd0f752c6fca02c9b45df474eb?submodules=1";
url = "github:microsoft/typescript-go/551b02d6c10e78610fc5ca7c23b77c9d531ee59b?submodules=1";
flake = false;
};
/* Source of truth: typescript-go's `_submodules/TypeScript` commit.
Expand Down
5 changes: 5 additions & 0 deletions shim/api/shim.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions shim/ast/shim.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions shim/core/shim.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions shim/ls/shim.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions shim/lsp/lsproto/shim.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions shim/project/logging/shim.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion shim/project/shim.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion typescript-go
Submodule typescript-go updated 302 files
Loading