Skip to content

getDefinitionAtPosition doesn't distinguish different kinds in a merged declaration #22467

@jeffreymorlan

Description

@jeffreymorlan

TypeScript Version: 2.7.2

Search Terms: getDefinitionAtPosition kind

Code

namespace A { export interface B {} }
class A {}
interface A {}

var x: A; // do getDefinitionAtPosition on the A reference here

Expected behavior:
In the result, each of the individual declarations should have the appropriate kind:

[
    { fileName: 'test.ts', textSpan: { start: 10, length: 1 }, kind: 'module', name: 'A', ... },
    { fileName: 'test.ts', textSpan: { start: 44, length: 1 }, kind: 'class', name: 'A', ... },
    { fileName: 'test.ts', textSpan: { start: 59, length: 1 }, kind: 'interface', name: 'A', ... }
]

Actual behavior:
All declarations have the same kind:

[
    { fileName: 'test.ts', textSpan: { start: 10, length: 1 }, kind: 'class', name: 'A', ... },
    { fileName: 'test.ts', textSpan: { start: 44, length: 1 }, kind: 'class', name: 'A', ... },
    { fileName: 'test.ts', textSpan: { start: 59, length: 1 }, kind: 'class', name: 'A', ... }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: APIRelates to the public API for TypeScriptGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do thisPursuitFellowshipHelp wanted from Pursuit fellowship; others please avoid until Dec 19

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions