Skip to content

navtree combines grandchilden symbols with same name #25694

Closed
@mjbvz

Description

@mjbvz

From microsoft/vscode#54364

TypeScript Version: 3.0.0-dev.20180713

Search Terms:

  • navtree

Code
Run navtree on the following js document:

const o = {
    a: {
        c() {}
    },
    b: {
        c() {}
    }
}

Expected behavior:
Separate entries for both instances of c are returned.

Actual behavior:
A combined entry with bothc is returned (note the "spans"), suggesting that these two symbols are the same

Result: {
    "text": "<global>",
    "kind": "script",
    "kindModifiers": "",
    "spans": [
        {
            "start": {
                "line": 1,
                "offset": 1
            },
            "end": {
                "line": 8,
                "offset": 2
            }
        }
    ],
    "childItems": [
        {
            "text": "o",
            "kind": "const",
            "kindModifiers": "",
            "spans": [
                {
                    "start": {
                        "line": 1,
                        "offset": 7
                    },
                    "end": {
                        "line": 8,
                        "offset": 2
                    }
                }
            ],
            "nameSpan": {
                "start": {
                    "line": 1,
                    "offset": 7
                },
                "end": {
                    "line": 1,
                    "offset": 8
                }
            },
            "childItems": [
                {
                    "text": "c",
                    "kind": "method",
                    "kindModifiers": "",
                    "spans": [
                        {
                            "start": {
                                "line": 3,
                                "offset": 9
                            },
                            "end": {
                                "line": 3,
                                "offset": 15
                            }
                        },
                        {
                            "start": {
                                "line": 6,
                                "offset": 9
                            },
                            "end": {
                                "line": 6,
                                "offset": 15
                            }
                        }
                    ],
                    "nameSpan": {
                        "start": {
                            "line": 3,
                            "offset": 9
                        },
                        "end": {
                            "line": 3,
                            "offset": 10
                        }
                    }
                }
            ]
        }
    ]
}

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions