diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index cb81c398cb8..2896031eb96 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -320,6 +320,9 @@ namespace ts.NavigationBar { case SyntaxKind.EnumMember: return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.memberVariableElement); + case SyntaxKind.InterfaceDeclaration: + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.interfaceElement); + case SyntaxKind.CallSignature: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); diff --git a/tests/cases/fourslash/navigationBarItemsInsideMethodsAndConstructors.ts b/tests/cases/fourslash/navigationBarItemsInsideMethodsAndConstructors.ts index 89b05dc6b07..d6fb0a91eb2 100644 --- a/tests/cases/fourslash/navigationBarItemsInsideMethodsAndConstructors.ts +++ b/tests/cases/fourslash/navigationBarItemsInsideMethodsAndConstructors.ts @@ -6,7 +6,7 @@ //// //// } //// -//// {| "itemName": "LocalInterfaceInConstrcutor", "kind": "interface", "parentName": ""|}interface LocalInterfaceInConstrcutor { +//// {| "itemName": "LocalInterfaceInConstrcutor", "kind": "interface", "parentName": "constructor"|}interface LocalInterfaceInConstrcutor { //// } //// //// {| "itemName": "LocalEnumInConstructor", "kind": "enum", "parentName": "constructor"|}enum LocalEnumInConstructor { @@ -21,7 +21,7 @@ //// } //// } //// -//// {| "itemName": "LocalInterfaceInMethod", "kind": "interface", "parentName": ""|}interface LocalInterfaceInMethod { +//// {| "itemName": "LocalInterfaceInMethod", "kind": "interface", "parentName": "method"|}interface LocalInterfaceInMethod { //// } //// //// {| "itemName": "LocalEnumInMethod", "kind": "enum", "parentName": "method"|}enum LocalEnumInMethod { @@ -39,4 +39,4 @@ test.markers().forEach((marker) => { }); // no other items -verify.navigationBarCount(19); +verify.navigationBarCount(21); diff --git a/tests/cases/fourslash/navigationBarItemsItems.ts b/tests/cases/fourslash/navigationBarItemsItems.ts index 5cae68b1194..d9ae3d35dff 100644 --- a/tests/cases/fourslash/navigationBarItemsItems.ts +++ b/tests/cases/fourslash/navigationBarItemsItems.ts @@ -1,7 +1,7 @@ /// ////// Interface -////{| "itemName": "IPoint", "kind": "interface", "parentName": "" |}interface IPoint { +////{| "itemName": "IPoint", "kind": "interface", "parentName": "" |}interface IPoint { //// {| "itemName": "getDist", "kind": "method", "parentName": "IPoint" |}getDist(): number; //// {| "itemName": "new()", "kind": "construct", "parentName": "IPoint" |}new(): IPoint; //// {| "itemName": "()", "kind": "call", "parentName": "IPoint" |}(): any; @@ -49,4 +49,4 @@ test.markers().forEach((marker) => { } }); -verify.navigationBarCount(24); +verify.navigationBarCount(25); diff --git a/tests/cases/fourslash/navigationBarItemsMultilineStringIdentifiers.ts b/tests/cases/fourslash/navigationBarItemsMultilineStringIdentifiers.ts index 8856c4c044a..f779c7a0580 100644 --- a/tests/cases/fourslash/navigationBarItemsMultilineStringIdentifiers.ts +++ b/tests/cases/fourslash/navigationBarItemsMultilineStringIdentifiers.ts @@ -10,7 +10,7 @@ ////{| "itemName": "\"MultilineMadness\"", "kind": "module" |} ////declare module "MultilineMadness" {} //// -////{| "itemName": "Foo", "kind": "interface" |} +////{| "itemName": "Foo", "kind": "interface", "parentName": "" |} ////interface Foo { //// {| "itemName": "\"a1\\\\\\r\\nb\"", "kind": "property", "parentName": "Foo" |} //// "a1\\\r\nb"; @@ -38,4 +38,4 @@ test.markers().forEach((marker) => { verify.navigationBarContains(marker.data.itemName, marker.data.kind, marker.fileName, marker.data.parentName); }); -verify.navigationBarCount(9); // interface w/ 2 properties, class w/ 2 properties, 3 modules \ No newline at end of file +verify.navigationBarCount(11); // interface w/ 2 properties, class w/ 2 properties, 3 modules \ No newline at end of file diff --git a/tests/cases/fourslash/navigationBarItemsSymbols2.ts b/tests/cases/fourslash/navigationBarItemsSymbols2.ts index 579a6353c13..5c398f77bbd 100644 --- a/tests/cases/fourslash/navigationBarItemsSymbols2.ts +++ b/tests/cases/fourslash/navigationBarItemsSymbols2.ts @@ -1,6 +1,6 @@ /// -////{| "itemName": "I", "kind": "interface", "parentName": "" |} +////{| "itemName": "I", "kind": "interface", "parentName": "" |} ////interface I { //// {| "itemName": "[Symbol.isRegExp]", "kind": "property", "parentName": "I" |} //// [Symbol.isRegExp]: string; @@ -12,4 +12,5 @@ test.markers().forEach(marker => { verify.navigationBarContains(marker.data.itemName, marker.data.kind, marker.fileName, marker.data.parentName); }); -verify.navigationBarCount(test.markers().length); \ No newline at end of file +// 2 are not marked: and its child. +verify.navigationBarCount(2 + test.markers().length); \ No newline at end of file diff --git a/tests/cases/fourslash/server/navbar01.ts b/tests/cases/fourslash/server/navbar01.ts index e4e2b699be5..05e92c2835f 100644 --- a/tests/cases/fourslash/server/navbar01.ts +++ b/tests/cases/fourslash/server/navbar01.ts @@ -1,7 +1,7 @@ /// ////// Interface -////{| "itemName": "IPoint", "kind": "interface", "parentName": "" |}interface IPoint { +////{| "itemName": "IPoint", "kind": "interface", "parentName": "" |}interface IPoint { //// {| "itemName": "getDist", "kind": "method", "parentName": "IPoint" |}getDist(): number; //// {| "itemName": "new()", "kind": "construct", "parentName": "IPoint" |}new(): IPoint; //// {| "itemName": "()", "kind": "call", "parentName": "IPoint" |}(): any; @@ -49,4 +49,4 @@ test.markers().forEach((marker) => { } }); -verify.navigationBarCount(24); +verify.navigationBarCount(25);