2016-06-16 22:20:12 +02:00
|
|
|
/// <reference path="fourslash.ts" />
|
|
|
|
|
|
|
|
////global.cls = class { };
|
|
|
|
////(function() {
|
|
|
|
//// const x = () => {
|
|
|
|
//// // Presence of inner function causes x to be a top-level function.
|
|
|
|
//// function xx() {}
|
|
|
|
//// };
|
|
|
|
//// const y = {
|
|
|
|
//// // This is not a top-level function (contains nothing, but shows up in childItems of its parent.)
|
|
|
|
//// foo: function() {}
|
|
|
|
//// };
|
|
|
|
//// (function nest() {
|
|
|
|
//// function moreNest() {}
|
|
|
|
//// })();
|
|
|
|
////})();
|
|
|
|
////(function() { // Different anonymous functions are not merged
|
|
|
|
//// // These will only show up as childItems.
|
|
|
|
//// function z() {}
|
|
|
|
//// console.log(function() {})
|
2018-12-28 02:01:05 +01:00
|
|
|
//// describe("this", 'function', `is a function`, `but this ${"wont"} show`, () => {});
|
2018-09-26 20:22:44 +02:00
|
|
|
//// [].map(() => {});
|
2016-06-16 22:20:12 +02:00
|
|
|
////})
|
|
|
|
////(function classes() {
|
|
|
|
//// // Classes show up in top-level regardless of whether they have names or inner declarations.
|
|
|
|
//// const cls2 = class { };
|
|
|
|
//// console.log(class cls3 {});
|
|
|
|
//// (class { });
|
|
|
|
////})
|
|
|
|
|
2016-10-11 16:48:28 +02:00
|
|
|
verify.navigationTree({
|
|
|
|
"text": "<global>",
|
|
|
|
"kind": "script",
|
|
|
|
"childItems": [
|
|
|
|
{
|
|
|
|
"text": "<function>",
|
|
|
|
"kind": "function",
|
|
|
|
"childItems": [
|
|
|
|
{
|
|
|
|
"text": "nest",
|
|
|
|
"kind": "function",
|
|
|
|
"childItems": [
|
|
|
|
{
|
|
|
|
"text": "moreNest",
|
|
|
|
"kind": "function"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "x",
|
2017-09-19 23:39:29 +02:00
|
|
|
"kind": "const",
|
2016-10-11 16:48:28 +02:00
|
|
|
"childItems": [
|
|
|
|
{
|
|
|
|
"text": "xx",
|
|
|
|
"kind": "function"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "y",
|
|
|
|
"kind": "const",
|
|
|
|
"childItems": [
|
|
|
|
{
|
|
|
|
"text": "foo",
|
2019-09-12 00:54:27 +02:00
|
|
|
"kind": "method"
|
2016-10-11 16:48:28 +02:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "<function>",
|
|
|
|
"kind": "function",
|
|
|
|
"childItems": [
|
|
|
|
{
|
2018-09-26 20:22:44 +02:00
|
|
|
"text": "console.log() callback",
|
|
|
|
"kind": "function"
|
|
|
|
},
|
|
|
|
{
|
2018-12-28 02:01:05 +01:00
|
|
|
"text": `describe("this", 'function', \`is a function\`) callback`,
|
2018-09-26 20:22:44 +02:00
|
|
|
"kind": "function"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": `map() callback`,
|
2016-10-11 16:48:28 +02:00
|
|
|
"kind": "function"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "z",
|
|
|
|
"kind": "function"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "classes",
|
|
|
|
"kind": "function",
|
|
|
|
"childItems": [
|
|
|
|
{
|
|
|
|
"text": "<class>",
|
|
|
|
"kind": "class"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "cls2",
|
2017-09-19 23:39:29 +02:00
|
|
|
"kind": "const"
|
2016-10-11 16:48:28 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "cls3",
|
|
|
|
"kind": "class"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2018-04-05 00:43:41 +02:00
|
|
|
"text": "cls",
|
2016-10-11 16:48:28 +02:00
|
|
|
"kind": "class"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2016-06-16 22:20:12 +02:00
|
|
|
verify.navigationBar([
|
|
|
|
{
|
|
|
|
"text": "<global>",
|
2016-07-26 19:41:20 +02:00
|
|
|
"kind": "script",
|
2016-06-16 22:20:12 +02:00
|
|
|
"childItems": [
|
|
|
|
{
|
|
|
|
"text": "<function>",
|
|
|
|
"kind": "function"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "<function>",
|
|
|
|
"kind": "function"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "classes",
|
|
|
|
"kind": "function"
|
|
|
|
},
|
|
|
|
{
|
2018-04-05 00:43:41 +02:00
|
|
|
"text": "cls",
|
2016-06-16 22:20:12 +02:00
|
|
|
"kind": "class"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "<function>",
|
|
|
|
"kind": "function",
|
|
|
|
"childItems": [
|
|
|
|
{
|
|
|
|
"text": "nest",
|
|
|
|
"kind": "function"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "x",
|
2017-09-19 23:39:29 +02:00
|
|
|
"kind": "const"
|
2016-06-16 22:20:12 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "y",
|
|
|
|
"kind": "const"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"indent": 1
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "nest",
|
|
|
|
"kind": "function",
|
|
|
|
"childItems": [
|
|
|
|
{
|
|
|
|
"text": "moreNest",
|
|
|
|
"kind": "function"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"indent": 2
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "x",
|
2017-09-19 23:39:29 +02:00
|
|
|
"kind": "const",
|
2016-06-16 22:20:12 +02:00
|
|
|
"childItems": [
|
|
|
|
{
|
|
|
|
"text": "xx",
|
|
|
|
"kind": "function"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"indent": 2
|
|
|
|
},
|
2016-08-29 16:28:14 +02:00
|
|
|
{
|
|
|
|
"text": "y",
|
|
|
|
"kind": "const",
|
|
|
|
"childItems": [
|
|
|
|
{
|
|
|
|
"text": "foo",
|
2019-09-12 00:54:27 +02:00
|
|
|
"kind": "method"
|
2016-08-29 16:28:14 +02:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"indent": 2
|
|
|
|
},
|
2016-06-16 22:20:12 +02:00
|
|
|
{
|
|
|
|
"text": "<function>",
|
|
|
|
"kind": "function",
|
|
|
|
"childItems": [
|
|
|
|
{
|
2018-09-26 20:22:44 +02:00
|
|
|
"text": "console.log() callback",
|
|
|
|
"kind": "function"
|
|
|
|
},
|
|
|
|
{
|
2018-12-28 02:01:05 +01:00
|
|
|
"text": `describe("this", 'function', \`is a function\`) callback`,
|
2018-09-26 20:22:44 +02:00
|
|
|
"kind": "function"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": `map() callback`,
|
2016-06-16 22:20:12 +02:00
|
|
|
"kind": "function"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "z",
|
|
|
|
"kind": "function"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"indent": 1
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "classes",
|
|
|
|
"kind": "function",
|
|
|
|
"childItems": [
|
|
|
|
{
|
|
|
|
"text": "<class>",
|
|
|
|
"kind": "class"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "cls2",
|
2017-09-19 23:39:29 +02:00
|
|
|
"kind": "const"
|
2016-06-16 22:20:12 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "cls3",
|
|
|
|
"kind": "class"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"indent": 1
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "<class>",
|
|
|
|
"kind": "class",
|
|
|
|
"indent": 2
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"text": "cls3",
|
|
|
|
"kind": "class",
|
|
|
|
"indent": 2
|
|
|
|
},
|
|
|
|
{
|
2018-04-05 00:43:41 +02:00
|
|
|
"text": "cls",
|
2016-06-16 22:20:12 +02:00
|
|
|
"kind": "class",
|
|
|
|
"indent": 1
|
|
|
|
}
|
|
|
|
]);
|