Skip to content

Duplicate definitions returned for go to definition  #24861

@mjbvz

Description

@mjbvz

microsoft/vscode#51489

TypeScript Version: 3.0.0-dev.20180608

Search Terms:

  • Go to definition

Code

export const _ = 1;

const f = x => console.log(x)
f()

Run go to definition on f

Expected behavior:
One definition entry returned

Actual behavior:
Two definition entries returned:

[Trace  - 8:58:30 AM] Response received: definition (207). Request took 1 ms. Success: true 
Result: [
    {
        "file": "/Users/matb/projects/san/App.js",
        "start": {
            "line": 3,
            "offset": 7
        },
        "end": {
            "line": 3,
            "offset": 8
        }
    },
    {
        "file": "/Users/matb/projects/san/App.js",
        "start": {
            "line": 3,
            "offset": 11
        },
        "end": {
            "line": 3,
            "offset": 30
        }
    }
]

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