TypeScript/tests/cases/fourslash/navigationBarItemsFunctions.ts
Jesse Trinity fd6fbdf7fe
Show more items in the navbar (#33040)
* show more items in navbar

* fixed missing node kind for property assignments

* updated navBarNestedCommonJsExports test

* updated navigationBarMerging_grandchildren test

* updated navigationBarItemsFunctions test

* updated navigationBarAnonymousClassAndFunctionExpressions test

* updated navigationBarFunctionIndirectlyInVariableDeclaration test

* updated navigationBarInitializerSpans test

* updated navigationBarItemsPropertiesDefinedInConstructors test

* updated tests

* change nav icon for properties with function-like initializers

* add test case for binding element with function-like initializer

* add navigationBarNestedObjectLiterals test

* add navigationBarFunctionLikePropertyAssignments test

* made some silly names less silly (?)

* added SpreadAssignments and ShorthandPropertyAssignments

* new wording for primary menu items
2019-09-11 15:54:27 -07:00

144 lines
3.3 KiB
TypeScript

/// <reference path="fourslash.ts"/>
////function foo() {
//// var x = 10;
//// function bar() {
//// var y = 10;
//// function biz() {
//// var z = 10;
//// }
//// function qux() {
//// // A function with an empty body should not be top level
//// }
//// }
////}
////
////function baz() {
//// var v = 10;
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "baz",
"kind": "function",
"childItems": [
{
"text": "v",
"kind": "var"
}
]
},
{
"text": "foo",
"kind": "function",
"childItems": [
{
"text": "bar",
"kind": "function",
"childItems": [
{
"text": "biz",
"kind": "function",
"childItems": [
{
"text": "z",
"kind": "var"
}
]
},
{
"text": "qux",
"kind": "function"
},
{
"text": "y",
"kind": "var"
}
]
},
{
"text": "x",
"kind": "var"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "baz",
"kind": "function"
},
{
"text": "foo",
"kind": "function"
}
]
},
{
"text": "baz",
"kind": "function",
"childItems": [
{
"text": "v",
"kind": "var"
}
],
"indent": 1
},
{
"text": "foo",
"kind": "function",
"childItems": [
{
"text": "bar",
"kind": "function"
},
{
"text": "x",
"kind": "var"
}
],
"indent": 1
},
{
"text": "bar",
"kind": "function",
"childItems": [
{
"text": "biz",
"kind": "function"
},
{
"text": "qux",
"kind": "function"
},
{
"text": "y",
"kind": "var"
}
],
"indent": 2
},
{
"text": "biz",
"kind": "function",
"childItems": [
{
"text": "z",
"kind": "var"
}
],
"indent": 3
},
]);