Microsoft/TypeScript

getDefinitionAtPosition doesn't distinguish different kinds in a merged declaration

Open

#22.467 geöffnet am 10. März 2018

Auf GitHub ansehen
 (13 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (6.726 Forks)batch import
BugDomain: APIGood First IssueHelp Wanted

Repository-Metriken

Stars
 (48.455 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6T 17h) (9 gemergte PRs in 30 T)

Beschreibung

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', ... }
]

Contributor Guide