2017-09-19 23:39:29 +02:00
|
|
|
/// <reference path="fourslash.ts" />
|
|
|
|
|
2019-09-12 00:54:27 +02:00
|
|
|
////// get the name for the navbar from the variable name rather than the function name
|
|
|
|
////const [|[|x|] = () => { var [|a|]; }|];
|
|
|
|
////const [|[|f|] = function f() { var [|b|]; }|];
|
|
|
|
////const [|[|y|] = { [|[|z|]: function z() { var [|c|]; }|] }|];
|
2017-09-19 23:39:29 +02:00
|
|
|
|
2019-09-12 00:54:27 +02:00
|
|
|
const [
|
|
|
|
s0,
|
|
|
|
s0Name,
|
|
|
|
s0Child,
|
|
|
|
s1,
|
|
|
|
s1Name,
|
|
|
|
s1Child,
|
|
|
|
s2,
|
|
|
|
s2Name,
|
|
|
|
s2Child,
|
|
|
|
s2ChildName,
|
|
|
|
s2GrandChildName
|
|
|
|
] = test.spans();
|
|
|
|
|
|
|
|
const sGlobal = { start: 0, length: 188 };
|
2017-09-19 23:39:29 +02:00
|
|
|
|
|
|
|
verify.navigationTree({
|
|
|
|
text: "<global>",
|
|
|
|
kind: "script",
|
|
|
|
spans: [sGlobal],
|
|
|
|
childItems: [
|
|
|
|
{
|
|
|
|
text: "f",
|
2019-09-12 00:54:27 +02:00
|
|
|
kind: "const",
|
2017-09-19 23:39:29 +02:00
|
|
|
spans: [s1],
|
2018-06-07 21:43:57 +02:00
|
|
|
nameSpan: s1Name,
|
2019-09-12 00:54:27 +02:00
|
|
|
childItems: [
|
|
|
|
{
|
|
|
|
text: "b",
|
|
|
|
kind: "var",
|
|
|
|
spans: [s1Child],
|
|
|
|
nameSpan: s1Child,
|
|
|
|
},
|
|
|
|
],
|
2017-09-19 23:39:29 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
text: "x",
|
|
|
|
kind: "const",
|
|
|
|
spans: [s0],
|
2018-06-07 21:43:57 +02:00
|
|
|
nameSpan: s0Name,
|
2019-09-12 00:54:27 +02:00
|
|
|
childItems: [
|
|
|
|
{
|
|
|
|
text: "a",
|
|
|
|
kind: "var",
|
|
|
|
spans: [s0Child],
|
|
|
|
nameSpan: s0Child,
|
|
|
|
},
|
|
|
|
],
|
2017-09-19 23:39:29 +02:00
|
|
|
},
|
2019-09-12 00:54:27 +02:00
|
|
|
{
|
|
|
|
text: "y",
|
|
|
|
kind: "const",
|
|
|
|
spans: [s2],
|
|
|
|
nameSpan: s2Name,
|
|
|
|
childItems:[
|
|
|
|
{
|
|
|
|
text: "z",
|
|
|
|
kind: "method",
|
|
|
|
spans: [s2Child],
|
|
|
|
nameSpan: s2ChildName,
|
|
|
|
childItems: [
|
|
|
|
{
|
|
|
|
text: "c",
|
|
|
|
kind: "var",
|
|
|
|
spans: [s2GrandChildName],
|
|
|
|
nameSpan: s2GrandChildName,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
2017-09-19 23:39:29 +02:00
|
|
|
]
|
|
|
|
}, { checkSpans: true });
|
|
|
|
|
|
|
|
verify.navigationBar([
|
|
|
|
{
|
|
|
|
text: "<global>",
|
|
|
|
kind: "script",
|
|
|
|
spans: [sGlobal],
|
|
|
|
childItems: [
|
|
|
|
{
|
|
|
|
text: "f",
|
2019-09-12 00:54:27 +02:00
|
|
|
kind: "const",
|
2017-09-19 23:39:29 +02:00
|
|
|
spans: [s1],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: "x",
|
|
|
|
kind: "const",
|
|
|
|
spans: [s0],
|
|
|
|
},
|
2019-09-12 00:54:27 +02:00
|
|
|
{
|
|
|
|
text: "y",
|
|
|
|
kind: "const",
|
|
|
|
spans: [s2],
|
|
|
|
}
|
2017-09-19 23:39:29 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: "f",
|
2019-09-12 00:54:27 +02:00
|
|
|
kind: "const",
|
2017-09-19 23:39:29 +02:00
|
|
|
spans: [s1],
|
2019-09-12 00:54:27 +02:00
|
|
|
childItems: [
|
|
|
|
{
|
|
|
|
text: "b",
|
|
|
|
kind: "var",
|
|
|
|
spans: [s1Child],
|
|
|
|
},
|
|
|
|
],
|
2017-09-19 23:39:29 +02:00
|
|
|
indent: 1,
|
|
|
|
},
|
2019-09-12 00:54:27 +02:00
|
|
|
{
|
|
|
|
text: "x",
|
|
|
|
kind: "const",
|
|
|
|
spans: [s0],
|
|
|
|
childItems: [
|
|
|
|
{
|
|
|
|
text: "a",
|
|
|
|
kind: "var",
|
|
|
|
spans: [s0Child],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
indent: 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: "y",
|
|
|
|
kind: "const",
|
|
|
|
spans: [s2],
|
|
|
|
childItems: [
|
|
|
|
{
|
|
|
|
text: "z",
|
|
|
|
kind: "method",
|
|
|
|
spans: [s2Child],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
indent: 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: "z",
|
|
|
|
kind: "method",
|
|
|
|
spans: [s2Child],
|
|
|
|
childItems: [
|
|
|
|
{
|
|
|
|
text: "c",
|
|
|
|
kind: "var",
|
|
|
|
spans: [s2GrandChildName],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
indent: 2,
|
|
|
|
},
|
2017-09-19 23:39:29 +02:00
|
|
|
], { checkSpans: true });
|