Skip to content

[navtree] Only a single nameSpan listed for multiple declarations of interface #35068

Open

Description

TypeScript Version: 3.7.2

Search Terms:

  • navtree
  • tsserver

Code
For the TypeScript:

interface IFoo2 {
    foo: any;
}

interface IFoo2 {
    foo2: any;
}
  1. Run a navTree request

Bug:
Two spans for IFoo2 are returned but there is only a single nameSpan

{
    "text": "<global>",
    "kind": "script",
    "kindModifiers": "",
    "spans": [
        {
            "start": {
                "line": 1,
                "offset": 1
            },
            "end": {
                "line": 8,
                "offset": 2
            }
        }
    ],
    "childItems": [
        {
            "text": "IFoo2",
            "kind": "interface",
            "kindModifiers": "",
            "spans": [
                {
                    "start": {
                        "line": 1,
                        "offset": 1
                    },
                    "end": {
                        "line": 3,
                        "offset": 2
                    }
                },
                {
                    "start": {
                        "line": 5,
                        "offset": 1
                    },
                    "end": {
                        "line": 7,
                        "offset": 2
                    }
                }
            ],
            "nameSpan": {
                "start": {
                    "line": 1,
                    "offset": 11
                },
                "end": {
                    "line": 1,
                    "offset": 16
                }
            },
            ...
        }
    ]
}

For VS Code's tooling, we'd like to have a list of all namespans

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions