Skip to content

Outline and breadcrumb show wrong namespace name #42259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jklosinski opened this issue Jan 5, 2021 · 3 comments · Fixed by #42332
Closed

Outline and breadcrumb show wrong namespace name #42259

jklosinski opened this issue Jan 5, 2021 · 3 comments · Fixed by #42332
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@jklosinski
Copy link

jklosinski commented Jan 5, 2021

TS Template added by @mjbvz

TypeScript Version: 4.2.0-dev.20210108

Search Terms

  • navtree
  • outline
  • breadcrumbs

  • VSCode Version: 1.52.1
  • OS Version: Windows 10.0.18363

Steps to Reproduce:

  1. Create a TS file as shown in the screenshot and then view the outline. Seems to only when multiple namespaces differ by only the last portion. If you add namespace Test.C { }, it will also display incorrectly as Test.A.

image

Does this issue occur when all extensions are disabled?: Yes

@vscodebot
Copy link

vscodebot bot commented Jan 5, 2021

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@mjbvz
Copy link
Contributor

mjbvz commented Jan 8, 2021

Text:

namespace Test.A { }

namespace Test.B {
    class Foo { }
}

@mjbvz mjbvz transferred this issue from microsoft/vscode Jan 8, 2021
@mjbvz
Copy link
Contributor

mjbvz commented Jan 8, 2021

Here's the navtree request:

[Trace  - 18:41:49.798] <syntax> Response received: navtree (128). Request took 2 ms. Success: true 
Result: {
    "text": "<global>",
    "kind": "script",
    "kindModifiers": "",
    "spans": [
        {
            "start": {
                "line": 1,
                "offset": 1
            },
            "end": {
                "line": 7,
                "offset": 3
            }
        }
    ],
    "childItems": [
        {
            "text": "Test.A",
            "kind": "module",
            "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": 15
                }
            },
            "childItems": [
                {
                    "text": "Foo",
                    "kind": "class",
                    "kindModifiers": "",
                    "spans": [
                        {
                            "start": {
                                "line": 6,
                                "offset": 5
                            },
                            "end": {
                                "line": 6,
                                "offset": 18
                            }
                        }
                    ],
                    "nameSpan": {
                        "start": {
                            "line": 6,
                            "offset": 11
                        },
                        "end": {
                            "line": 6,
                            "offset": 14
                        }
                    }
                }
            ]
        }
    ]
}

@mjbvz mjbvz removed their assignment Jan 8, 2021
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Jan 8, 2021
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 4.3.0 milestone Jan 8, 2021
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants