Skip to content

navtree does not include entry for export default of an expression #34601

@mjbvz

Description

@mjbvz

From microsoft/vscode#79686

TypeScript Version: 3.7.0-dev.20191016

Search Terms:

  • navtree
  • outline
  • tsserver

Code
For the code:

const abc = 12;

export default abc;
  1. Make a navtree request against TS Server

Expected behavior:
An entry for the export default abc is included. VS Code needs this information in order to show the references code lens on the default export

Actual behavior:
No entry for the export itself is returned

[Trace  - 4:23:03 PM] <syntax> Response received: navtree (225). Request took 1 ms. Success: true 
Result: {
    "text": "\"foo\"",
    "kind": "module",
    "kindModifiers": "",
    "spans": [
        {
            "start": {
                "line": 1,
                "offset": 1
            },
            "end": {
                "line": 4,
                "offset": 4
            }
        }
    ],
    "childItems": [
        {
            "text": "abc",
            "kind": "const",
            "kindModifiers": "",
            "spans": [
                {
                    "start": {
                        "line": 1,
                        "offset": 7
                    },
                    "end": {
                        "line": 1,
                        "offset": 15
                    }
                }
            ],
            "nameSpan": {
                "start": {
                    "line": 1,
                    "offset": 7
                },
                "end": {
                    "line": 1,
                    "offset": 10
                }
            }
        }
    ]
}

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions