From 953d4e94cd5b7e484c7191de2af5f39c0049962a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 00:39:00 +0000 Subject: [PATCH 1/5] Initial plan From b78c1f194577dc1c1d7b7b3bd235aa7804eb717a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 00:47:30 +0000 Subject: [PATCH 2/5] Fix ambient module quick info to display 'module' instead of 'namespace' Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com> --- internal/ls/hover.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/ls/hover.go b/internal/ls/hover.go index 291d6fa1506..6ae1babe0b4 100644 --- a/internal/ls/hover.go +++ b/internal/ls/hover.go @@ -365,7 +365,8 @@ func getQuickInfoAndDeclarationAtLocation(c *checker.Checker, symbol *ast.Symbol } if flags&ast.SymbolFlagsModule != 0 { writeNewLine() - b.WriteString(core.IfElse(symbol.ValueDeclaration != nil && ast.IsSourceFile(symbol.ValueDeclaration), "module ", "namespace ")) + isModule := symbol.ValueDeclaration != nil && (ast.IsSourceFile(symbol.ValueDeclaration) || ast.IsAmbientModule(symbol.ValueDeclaration)) + b.WriteString(core.IfElse(isModule, "module ", "namespace ")) b.WriteString(c.SymbolToStringEx(symbol, container, ast.SymbolFlagsNone, symbolFormatFlags)) setDeclaration(core.Find(symbol.Declarations, ast.IsModuleDeclaration)) } From 635a31a3eae8599e0e339253dd7b5e7a8d3d4686 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 00:48:58 +0000 Subject: [PATCH 3/5] Add tests for ambient module and namespace quick info Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com> --- .../tests/quickInfoAmbientModule_test.go | 19 +++++++++++++++++ .../tests/quickInfoNamespace_test.go | 21 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 internal/fourslash/tests/quickInfoAmbientModule_test.go create mode 100644 internal/fourslash/tests/quickInfoNamespace_test.go diff --git a/internal/fourslash/tests/quickInfoAmbientModule_test.go b/internal/fourslash/tests/quickInfoAmbientModule_test.go new file mode 100644 index 00000000000..0d2d3bef45a --- /dev/null +++ b/internal/fourslash/tests/quickInfoAmbientModule_test.go @@ -0,0 +1,19 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoAmbientModule(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `declare module "*.css/*1*/";` + + f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content) + defer done() + f.VerifyQuickInfoAt(t, "1", `module "*.css"`, "") +} diff --git a/internal/fourslash/tests/quickInfoNamespace_test.go b/internal/fourslash/tests/quickInfoNamespace_test.go new file mode 100644 index 00000000000..6ba11db28b4 --- /dev/null +++ b/internal/fourslash/tests/quickInfoNamespace_test.go @@ -0,0 +1,21 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestQuickInfoNamespace(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `namespace /*1*/MyNamespace { + export const x = 1; +}` + + f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content) + defer done() + f.VerifyQuickInfoAt(t, "1", "namespace MyNamespace", "") +} From ccb0c80cfb1b003219d797e31b232be07d83727d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 00:50:41 +0000 Subject: [PATCH 4/5] Fix test marker position in ambient module test Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com> --- internal/fourslash/tests/quickInfoAmbientModule_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/fourslash/tests/quickInfoAmbientModule_test.go b/internal/fourslash/tests/quickInfoAmbientModule_test.go index 0d2d3bef45a..f015460ee68 100644 --- a/internal/fourslash/tests/quickInfoAmbientModule_test.go +++ b/internal/fourslash/tests/quickInfoAmbientModule_test.go @@ -11,7 +11,7 @@ func TestQuickInfoAmbientModule(t *testing.T) { t.Parallel() defer testutil.RecoverAndFail(t, "Panic on fourslash test") - const content = `declare module "*.css/*1*/";` + const content = `declare module "*.css"/*1*/;` f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content) defer done() From 09c1f763f66d6428cb4fd189602cc355d319e1d0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 03:02:07 +0000 Subject: [PATCH 5/5] Remove duplicate namespace quick info test Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com> --- .../tests/quickInfoNamespace_test.go | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100644 internal/fourslash/tests/quickInfoNamespace_test.go diff --git a/internal/fourslash/tests/quickInfoNamespace_test.go b/internal/fourslash/tests/quickInfoNamespace_test.go deleted file mode 100644 index 6ba11db28b4..00000000000 --- a/internal/fourslash/tests/quickInfoNamespace_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package fourslash_test - -import ( - "testing" - - "github.com/microsoft/typescript-go/internal/fourslash" - "github.com/microsoft/typescript-go/internal/testutil" -) - -func TestQuickInfoNamespace(t *testing.T) { - t.Parallel() - - defer testutil.RecoverAndFail(t, "Panic on fourslash test") - const content = `namespace /*1*/MyNamespace { - export const x = 1; -}` - - f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content) - defer done() - f.VerifyQuickInfoAt(t, "1", "namespace MyNamespace", "") -}