Merge pull request #8813 from Microsoft/navbar_interface

Include interfaces as childItems in navigation bar
This commit is contained in:
Andy 2016-05-25 10:12:01 -07:00
commit d26d0cea71
6 changed files with 15 additions and 11 deletions

View file

@ -320,6 +320,9 @@ namespace ts.NavigationBar {
case SyntaxKind.EnumMember:
return createItem(node, getTextOfNode((<EnumMember>node).name), ts.ScriptElementKind.memberVariableElement);
case SyntaxKind.InterfaceDeclaration:
return createItem(node, getTextOfNode((<InterfaceDeclaration>node).name), ts.ScriptElementKind.interfaceElement);
case SyntaxKind.CallSignature:
return createItem(node, "()", ts.ScriptElementKind.callSignatureElement);

View file

@ -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);

View file

@ -1,7 +1,7 @@
/// <reference path="fourslash.ts"/>
////// Interface
////{| "itemName": "IPoint", "kind": "interface", "parentName": "" |}interface IPoint {
////{| "itemName": "IPoint", "kind": "interface", "parentName": "<global>" |}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);

View file

@ -10,7 +10,7 @@
////{| "itemName": "\"MultilineMadness\"", "kind": "module" |}
////declare module "MultilineMadness" {}
////
////{| "itemName": "Foo", "kind": "interface" |}
////{| "itemName": "Foo", "kind": "interface", "parentName": "<global>" |}
////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
verify.navigationBarCount(11); // interface w/ 2 properties, class w/ 2 properties, 3 modules

View file

@ -1,6 +1,6 @@
/// <reference path="fourslash.ts"/>
////{| "itemName": "I", "kind": "interface", "parentName": "" |}
////{| "itemName": "I", "kind": "interface", "parentName": "<global>" |}
////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);
// 2 are not marked: <global> and its child.
verify.navigationBarCount(2 + test.markers().length);

View file

@ -1,7 +1,7 @@
/// <reference path="../fourslash.ts"/>
////// Interface
////{| "itemName": "IPoint", "kind": "interface", "parentName": "" |}interface IPoint {
////{| "itemName": "IPoint", "kind": "interface", "parentName": "<global>" |}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);