Skip to content

Commit 69d66cc

Browse files
dependabot[bot]github-actions[bot]buke
authored
deps(deps): bump microsoft/typescript-go from e027a2a to 63b00de (#26)
* deps(deps): bump microsoft/typescript-go from `e027a2a` to `63b00de` Bumps [microsoft/typescript-go](https://github.com/microsoft/typescript-go) from `e027a2a` to `63b00de`. - [Commits](microsoft/typescript-go@e027a2a...63b00de) --- updated-dependencies: - dependency-name: microsoft/typescript-go dependency-version: 63b00de5083cdfffdb77df46341a8d30bd9c3b67 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * chore(sync): mirror internal packages into pkg/ (auto) (#27) Co-authored-by: buke <1013738+buke@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: buke <1013738+buke@users.noreply.github.com>
1 parent 63b2695 commit 69d66cc

File tree

129 files changed

+5290
-2855
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+5290
-2855
lines changed

microsoft/typescript-go

Submodule typescript-go updated 128 files

pkg/checker/grammarchecks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2191,7 +2191,7 @@ func (c *Checker) checkGrammarImportCallExpression(node *ast.Node) bool {
21912191

21922192
nodeArguments := nodeAsCall.Arguments
21932193
argumentNodes := nodeArguments.Nodes
2194-
if c.moduleKind != core.ModuleKindESNext && c.moduleKind != core.ModuleKindNodeNext && c.moduleKind != core.ModuleKindNode16 && c.moduleKind != core.ModuleKindPreserve {
2194+
if !(core.ModuleKindNode16 <= c.moduleKind && c.moduleKind <= core.ModuleKindNodeNext) && c.moduleKind != core.ModuleKindESNext && c.moduleKind != core.ModuleKindPreserve {
21952195
// We are allowed trailing comma after proposal-import-assertions.
21962196
c.checkGrammarForDisallowedTrailingComma(nodeArguments, diagnostics.Trailing_comma_not_allowed)
21972197

pkg/fourslash/_scripts/convertFourslash.mts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ function parseVerifyApplyCodeActionArgs(arg: ts.Expression): string | undefined
506506
return undefined;
507507
}
508508
}
509-
props.push(`AutoImportData: &ls.AutoImportData{\n${dataProps.join("\n")}\n},`);
509+
props.push(`AutoImportData: &lsproto.AutoImportData{\n${dataProps.join("\n")}\n},`);
510510
break;
511511
case "description":
512512
descInit = getStringLiteralLike(init);
@@ -944,16 +944,16 @@ function parseExpectedCompletionItem(expr: ts.Expression, codeActionArgs?: Verif
944944
if (sourceInit = getStringLiteralLike(init)) {
945945
if (propName === "source" && sourceInit.text.endsWith("/")) {
946946
// source: "ClassMemberSnippet/"
947-
itemProps.push(`Data: PtrTo(any(&ls.CompletionItemData{
947+
itemProps.push(`Data: &lsproto.CompletionItemData{
948948
Source: ${getGoStringLiteral(sourceInit.text)},
949-
})),`);
949+
},`);
950950
break;
951951
}
952-
itemProps.push(`Data: PtrTo(any(&ls.CompletionItemData{
953-
AutoImport: &ls.AutoImportData{
952+
itemProps.push(`Data: &lsproto.CompletionItemData{
953+
AutoImport: &lsproto.AutoImportData{
954954
ModuleSpecifier: ${getGoStringLiteral(sourceInit.text)},
955955
},
956-
})),`);
956+
},`);
957957
}
958958
else {
959959
console.error(`Expected string literal for source/sourceDisplay, got ${init.getText()}`);

pkg/fourslash/fourslash.go

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,13 @@ func (f *FourslashTest) nextID() int32 {
252252
}
253253

254254
func (f *FourslashTest) initialize(t *testing.T, capabilities *lsproto.ClientCapabilities) {
255-
initOptions := map[string]any{
256-
// Hack: disable push diagnostics entirely, since the fourslash runner does not
257-
// yet gracefully handle non-request messages.
258-
"disablePushDiagnostics": true,
259-
}
260255
params := &lsproto.InitializeParams{
261-
Locale: ptrTo("en-US"),
262-
InitializationOptions: ptrTo[any](initOptions),
256+
Locale: ptrTo("en-US"),
257+
InitializationOptions: &lsproto.InitializationOptions{
258+
// Hack: disable push diagnostics entirely, since the fourslash runner does not
259+
// yet gracefully handle non-request messages.
260+
DisablePushDiagnostics: ptrTo(true),
261+
},
263262
}
264263
params.Capabilities = getCapabilitiesWithDefaults(capabilities)
265264
// !!! check for errors?
@@ -717,8 +716,8 @@ func (f *FourslashTest) VerifyCompletions(t *testing.T, markerInput MarkerInput,
717716
if item.Label != expectedAction.Name || item.Data == nil {
718717
return false
719718
}
720-
data, ok := (*item.Data).(*ls.CompletionItemData)
721-
if !ok || data.AutoImport == nil {
719+
data := item.Data
720+
if data.AutoImport == nil {
722721
return false
723722
}
724723
return data.AutoImport.ModuleSpecifier == expectedAction.Source
@@ -956,16 +955,12 @@ var (
956955
)
957956

958957
func (f *FourslashTest) verifyCompletionItem(t *testing.T, prefix string, actual *lsproto.CompletionItem, expected *lsproto.CompletionItem) {
959-
var actualAutoImportData, expectedAutoImportData *ls.AutoImportData
958+
var actualAutoImportData, expectedAutoImportData *lsproto.AutoImportData
960959
if actual.Data != nil {
961-
if data, ok := (*actual.Data).(*ls.CompletionItemData); ok {
962-
actualAutoImportData = data.AutoImport
963-
}
960+
actualAutoImportData = actual.Data.AutoImport
964961
}
965962
if expected.Data != nil {
966-
if data, ok := (*expected.Data).(*ls.CompletionItemData); ok {
967-
expectedAutoImportData = data.AutoImport
968-
}
963+
expectedAutoImportData = expected.Data.AutoImport
969964
}
970965
if (actualAutoImportData == nil) != (expectedAutoImportData == nil) {
971966
t.Fatal(prefix + "Mismatch in auto-import data presence")
@@ -1034,7 +1029,7 @@ func assertDeepEqual(t *testing.T, actual any, expected any, prefix string, opts
10341029
type ApplyCodeActionFromCompletionOptions struct {
10351030
Name string
10361031
Source string
1037-
AutoImportData *ls.AutoImportData
1032+
AutoImportData *lsproto.AutoImportData
10381033
Description string
10391034
NewFileContent *string
10401035
NewRangeContent *string
@@ -1058,16 +1053,13 @@ func (f *FourslashTest) VerifyApplyCodeActionFromCompletion(t *testing.T, marker
10581053
if item.Label != options.Name || item.Data == nil {
10591054
return false
10601055
}
1061-
data, ok := (*item.Data).(*ls.CompletionItemData)
1062-
if !ok {
1063-
return false
1064-
}
1056+
data := item.Data
10651057
if options.AutoImportData != nil {
10661058
return data.AutoImport != nil && ((data.AutoImport.FileName == options.AutoImportData.FileName) &&
10671059
(options.AutoImportData.ModuleSpecifier == "" || data.AutoImport.ModuleSpecifier == options.AutoImportData.ModuleSpecifier) &&
10681060
(options.AutoImportData.ExportName == "" || data.AutoImport.ExportName == options.AutoImportData.ExportName) &&
1069-
(options.AutoImportData.AmbientModuleName == nil || data.AutoImport.AmbientModuleName == options.AutoImportData.AmbientModuleName) &&
1070-
(options.AutoImportData.IsPackageJsonImport == core.TSUnknown || data.AutoImport.IsPackageJsonImport == options.AutoImportData.IsPackageJsonImport))
1061+
(options.AutoImportData.AmbientModuleName == "" || data.AutoImport.AmbientModuleName == options.AutoImportData.AmbientModuleName) &&
1062+
data.AutoImport.IsPackageJsonImport == options.AutoImportData.IsPackageJsonImport)
10711063
}
10721064
if data.AutoImport == nil && data.Source != "" && data.Source == options.Source {
10731065
return true

pkg/fourslash/tests/gen/autoImportCompletionAmbientMergedModule1_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55

66
"github.com/buke/typescript-go-internal/pkg/fourslash"
77
. "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util"
8-
"github.com/buke/typescript-go-internal/pkg/ls"
98
"github.com/buke/typescript-go-internal/pkg/lsp/lsproto"
109
"github.com/buke/typescript-go-internal/pkg/testutil"
1110
)
@@ -57,9 +56,9 @@ export class MoveInsideNextQuote extends MoveQuoteMatch {/*1*/
5756
InsertText: PtrTo("public execActionWithCount(position: Position): Promise<void> {\n}"),
5857
FilterText: PtrTo("execActionWithCount"),
5958
AdditionalTextEdits: fourslash.AnyTextEdits,
60-
Data: PtrTo(any(&ls.CompletionItemData{
59+
Data: &lsproto.CompletionItemData{
6160
Source: "ClassMemberSnippet/",
62-
})),
61+
},
6362
},
6463
},
6564
},

pkg/fourslash/tests/gen/autoImportCompletionExportEqualsWithDefault1_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55

66
"github.com/buke/typescript-go-internal/pkg/fourslash"
77
. "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util"
8-
"github.com/buke/typescript-go-internal/pkg/ls"
98
"github.com/buke/typescript-go-internal/pkg/lsp/lsproto"
109
"github.com/buke/typescript-go-internal/pkg/testutil"
1110
)
@@ -75,9 +74,9 @@ export = Container;`
7574
InsertText: PtrTo("parent: Container_ | Document_ | undefined;"),
7675
FilterText: PtrTo("parent"),
7776
AdditionalTextEdits: fourslash.AnyTextEdits,
78-
Data: PtrTo(any(&ls.CompletionItemData{
77+
Data: &lsproto.CompletionItemData{
7978
Source: "ClassMemberSnippet/",
80-
})),
79+
},
8180
},
8281
},
8382
},

pkg/fourslash/tests/gen/autoImportCompletionExportListAugmentation1_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55

66
"github.com/buke/typescript-go-internal/pkg/fourslash"
77
. "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util"
8-
"github.com/buke/typescript-go-internal/pkg/ls"
98
"github.com/buke/typescript-go-internal/pkg/lsp/lsproto"
109
"github.com/buke/typescript-go-internal/pkg/testutil"
1110
)
@@ -51,9 +50,9 @@ class FullPiece extends Piece {
5150
InsertText: PtrTo("container: Container;"),
5251
FilterText: PtrTo("container"),
5352
AdditionalTextEdits: fourslash.AnyTextEdits,
54-
Data: PtrTo(any(&ls.CompletionItemData{
53+
Data: &lsproto.CompletionItemData{
5554
Source: "ClassMemberSnippet/",
56-
})),
55+
},
5756
},
5857
},
5958
},

pkg/fourslash/tests/gen/autoImportCompletionExportListAugmentation2_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55

66
"github.com/buke/typescript-go-internal/pkg/fourslash"
77
. "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util"
8-
"github.com/buke/typescript-go-internal/pkg/ls"
98
"github.com/buke/typescript-go-internal/pkg/lsp/lsproto"
109
"github.com/buke/typescript-go-internal/pkg/testutil"
1110
)
@@ -59,9 +58,9 @@ class PingCommand extends Command {
5958
InsertText: PtrTo("get container(): Container {\n}"),
6059
FilterText: PtrTo("container"),
6160
AdditionalTextEdits: fourslash.AnyTextEdits,
62-
Data: PtrTo(any(&ls.CompletionItemData{
61+
Data: &lsproto.CompletionItemData{
6362
Source: "ClassMemberSnippet/",
64-
})),
63+
},
6564
},
6665
},
6766
},

pkg/fourslash/tests/gen/autoImportCompletionExportListAugmentation3_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55

66
"github.com/buke/typescript-go-internal/pkg/fourslash"
77
. "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util"
8-
"github.com/buke/typescript-go-internal/pkg/ls"
98
"github.com/buke/typescript-go-internal/pkg/lsp/lsproto"
109
"github.com/buke/typescript-go-internal/pkg/testutil"
1110
)
@@ -50,9 +49,9 @@ class FullPiece extends Piece {
5049
InsertText: PtrTo("container: Container;"),
5150
FilterText: PtrTo("container"),
5251
AdditionalTextEdits: fourslash.AnyTextEdits,
53-
Data: PtrTo(any(&ls.CompletionItemData{
52+
Data: &lsproto.CompletionItemData{
5453
Source: "ClassMemberSnippet/",
55-
})),
54+
},
5655
},
5756
},
5857
},

pkg/fourslash/tests/gen/autoImportCompletionExportListAugmentation4_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55

66
"github.com/buke/typescript-go-internal/pkg/fourslash"
77
. "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util"
8-
"github.com/buke/typescript-go-internal/pkg/ls"
98
"github.com/buke/typescript-go-internal/pkg/lsp/lsproto"
109
"github.com/buke/typescript-go-internal/pkg/testutil"
1110
)
@@ -57,9 +56,9 @@ class PingCommand extends CommandAlias {
5756
InsertText: PtrTo("get container(): Container {\n}"),
5857
FilterText: PtrTo("container"),
5958
AdditionalTextEdits: fourslash.AnyTextEdits,
60-
Data: PtrTo(any(&ls.CompletionItemData{
59+
Data: &lsproto.CompletionItemData{
6160
Source: "ClassMemberSnippet/",
62-
})),
61+
},
6362
},
6463
},
6564
},

0 commit comments

Comments
 (0)