Skip to content

Commit 6ffe427

Browse files
Merge pull request #29181 from uniqueiniquity/templateLiteralInNavTree
Show template literal in navtree function call args
2 parents b8def16 + c46090b commit 6ffe427

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/services/navigationBar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ namespace ts.NavigationBar {
660660
else if (isCallExpression(parent)) {
661661
const name = getCalledExpressionName(parent.expression);
662662
if (name !== undefined) {
663-
const args = mapDefined(parent.arguments, a => isStringLiteral(a) ? a.getText(curSourceFile) : undefined).join(", ");
663+
const args = mapDefined(parent.arguments, a => isStringLiteralLike(a) ? a.getText(curSourceFile) : undefined).join(", ");
664664
return `${name}(${args}) callback`;
665665
}
666666
}

tests/cases/fourslash/navigationBarAnonymousClassAndFunctionExpressions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//// // These will only show up as childItems.
1919
//// function z() {}
2020
//// console.log(function() {})
21-
//// describe("this", 'function', () => {});
21+
//// describe("this", 'function', `is a function`, `but this ${"wont"} show`, () => {});
2222
//// [].map(() => {});
2323
////})
2424
////(function classes() {
@@ -77,7 +77,7 @@ verify.navigationTree({
7777
"kind": "function"
7878
},
7979
{
80-
"text": `describe("this", 'function') callback`,
80+
"text": `describe("this", 'function', \`is a function\`) callback`,
8181
"kind": "function"
8282
},
8383
{
@@ -199,7 +199,7 @@ verify.navigationBar([
199199
"kind": "function"
200200
},
201201
{
202-
"text": `describe("this", 'function') callback`,
202+
"text": `describe("this", 'function', \`is a function\`) callback`,
203203
"kind": "function"
204204
},
205205
{

0 commit comments

Comments
 (0)