mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
navigationBar: Fix bug for shorthand ambient module (#25992)
This commit is contained in:
parent
af3f737451
commit
3bfe91cdd8
@ -612,7 +612,7 @@ namespace ts.NavigationBar {
|
||||
* We store 'A' as associated with a NavNode, and use getModuleName to traverse down again.
|
||||
*/
|
||||
function getInteriorModule(decl: ModuleDeclaration): ModuleDeclaration {
|
||||
return decl.body!.kind === SyntaxKind.ModuleDeclaration ? getInteriorModule(<ModuleDeclaration>decl.body) : decl; // TODO: GH#18217
|
||||
return decl.body && isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl;
|
||||
}
|
||||
|
||||
function isComputedProperty(member: EnumMember): boolean {
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
////
|
||||
////declare module 'X2.Y2.Z2' {}
|
||||
////
|
||||
////declare module "foo";
|
||||
////
|
||||
////module A.B.C {
|
||||
//// export var x;
|
||||
////}
|
||||
@ -24,9 +26,6 @@
|
||||
//// }
|
||||
////}
|
||||
|
||||
//We have 8 module keywords, and 4 var keywords.
|
||||
//The declarations of A.B.C.x do not get merged, so the 4 vars are independent.
|
||||
//The two 'A' modules, however, do get merged, so in reality we have 7 modules.
|
||||
verify.navigationTree({
|
||||
"text": "<global>",
|
||||
"kind": "script",
|
||||
@ -36,6 +35,11 @@ verify.navigationTree({
|
||||
"kind": "module",
|
||||
"kindModifiers": "declare"
|
||||
},
|
||||
{
|
||||
"text": "\"foo\"",
|
||||
"kind": "module",
|
||||
"kindModifiers": "declare"
|
||||
},
|
||||
{
|
||||
"text": "\"X.Y.Z\"",
|
||||
"kind": "module",
|
||||
@ -104,6 +108,11 @@ verify.navigationBar([
|
||||
"kind": "module",
|
||||
"kindModifiers": "declare"
|
||||
},
|
||||
{
|
||||
"text": "\"foo\"",
|
||||
"kind": "module",
|
||||
"kindModifiers": "declare"
|
||||
},
|
||||
{
|
||||
"text": "\"X.Y.Z\"",
|
||||
"kind": "module",
|
||||
@ -129,6 +138,12 @@ verify.navigationBar([
|
||||
"kindModifiers": "declare",
|
||||
"indent": 1
|
||||
},
|
||||
{
|
||||
"text": "\"foo\"",
|
||||
"kind": "module",
|
||||
"kindModifiers": "declare",
|
||||
"indent": 1
|
||||
},
|
||||
{
|
||||
"text": "\"X.Y.Z\"",
|
||||
"kind": "module",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user