TypeScript/tests/cases/fourslash/navigationBarItemsFunctions.ts

144 lines
3.3 KiB
TypeScript
Raw Normal View History

2014-09-18 02:40:32 +02:00
/// <reference path="fourslash.ts"/>
////function foo() {
2014-09-18 02:40:32 +02:00
//// var x = 10;
//// function bar() {
2014-09-18 02:40:32 +02:00
//// var y = 10;
//// function biz() {
2014-09-18 02:40:32 +02:00
//// var z = 10;
//// }
//// function qux() {
//// // A function with an empty body should not be top level
//// }
2014-09-18 02:40:32 +02:00
//// }
////}
////
////function baz() {
2014-09-18 02:40:32 +02:00
//// 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",
2016-06-16 22:20:12 +02:00
"childItems": [
{
"text": "v",
"kind": "var"
}
],
"indent": 1
},
{
"text": "foo",
"kind": "function",
"childItems": [
{
"text": "bar",
"kind": "function"
2016-06-16 22:20:12 +02:00
},
{
"text": "x",
"kind": "var"
}
],
"indent": 1
},
{
"text": "bar",
"kind": "function",
"childItems": [
{
"text": "biz",
"kind": "function"
2016-06-16 22:20:12 +02:00
},
{
"text": "qux",
"kind": "function"
},
2016-06-16 22:20:12 +02:00
{
"text": "y",
"kind": "var"
}
],
"indent": 2
},
{
"text": "biz",
"kind": "function",
"childItems": [
{
"text": "z",
"kind": "var"
}
],
"indent": 3
},
]);