Fix hover text for ambient modules to display "module" instead of "namespace"#2668
Open
Fix hover text for ambient modules to display "module" instead of "namespace"#2668
Conversation
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix quick info display for ambient module namespace keyword
Fix hover text for ambient modules to display "module" instead of "namespace"
Feb 4, 2026
|
|
||
| f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content) | ||
| defer done() | ||
| f.VerifyQuickInfoAt(t, "1", "namespace MyNamespace", "") |
Member
There was a problem hiding this comment.
Check if we already have a test for namespace quick info/hover. We probably do. If we do, delete this test.
Contributor
Author
There was a problem hiding this comment.
Removed the duplicate test. The existing quickInfoDisplayPartsModules_test.go already covers namespace quick info verification. (commit 09c1f76)
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes a bug where hovering over ambient module declarations (e.g., declare module "*.css") incorrectly displayed "namespace" instead of "module" in the quick info/hover text.
Changes:
- Fixed the hover text logic to correctly identify ambient modules using
ast.IsAmbientModule() - Added a test case to verify ambient modules display as "module" rather than "namespace"
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/ls/hover.go | Updated quick info generation to check for ambient modules (modules with string literal names) and display them as "module" instead of "namespace" |
| internal/fourslash/tests/quickInfoAmbientModule_test.go | Added test to verify ambient modules like declare module "*.css" show "module" in hover text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix quick info/hover display for ambient modules
module "*.css"incorrectly shownamespace "*.css"instead ofmodule "*.css"in hover/quick info/home/runner/work/typescript-go/typescript-go/internal/ls/hover.goat lines 366-371ast.IsAmbientModule()quickInfoDisplayPartsModules_test.go)Original prompt
namespacekeyword #2667💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.