Skip to content

Commit 1a48da9

Browse files
Don't show locals as children of functions.
1 parent 3a6c328 commit 1a48da9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/services/navigationBar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ module ts.NavigationBar {
313313

314314
function createFunctionItem(node: FunctionDeclaration) {
315315
if (node.name && node.body && node.body.kind === SyntaxKind.FunctionBlock) {
316-
var childItems = getItemsWorker(getChildNodes((<Block>node.body).statements), createChildItem);
316+
var childItems = getItemsWorker(sortNodes((<Block>node.body).statements), createChildItem);
317317

318318
return getNavigationBarItem(node.name.text,
319319
ts.ScriptElementKind.functionElement,

tests/cases/fourslash/scriptLexicalStructureFunctions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ test.markers().forEach((marker) => {
2020
verify.getScriptLexicalStructureListContains(marker.data.itemName, marker.data.kind, marker.fileName, marker.data.parentName);
2121
});
2222

23-
verify.getScriptLexicalStructureListCount(9); // 4 functions + global. Note: there are 9 because of the functions show up at the top level and as child items.
23+
verify.getScriptLexicalStructureListCount(7); // 4 functions + global. Note: there are 7 because of the functions show up at the top level and as child items.

0 commit comments

Comments
 (0)